op_deviceio.c File Reference

#include "op_deviceio.h"
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
Include dependency graph for op_deviceio.c:

Go to the source code of this file.

Functions

fd_t op_open_device (char const *name)
ssize_t op_read_device (fd_t devfd, void *buf, size_t size)

Detailed Description

Reading from a special device

Remarks:
Copyright 2002 OProfile authors
Read the file COPYING
Author:
John Levon
Philippe Elie

Definition in file op_deviceio.c.


Function Documentation

fd_t op_open_device ( char const *  name  ) 

op_open_device - open a special char device for reading

Parameters:
name file name of device file

Open the special file name. Returns the file descriptor for the file or -1 on error.

Definition at line 22 of file op_deviceio.c.

Referenced by op_open_files(), and opd_open_files().

Here is the caller graph for this function:

ssize_t op_read_device ( fd_t  devfd,
void *  buf,
size_t  size 
)

op_read_device - read from a special char device

Parameters:
devfd file descriptor of device
buf buffer
size size of buffer

Read size bytes from a device into buffer buf. A seek to the start of the device file is done first then a read is requested in one go of size bytes.

It is the caller's responsibility to do further op_read_device() calls if the number of bytes read is not what is requested (where this is applicable).

The number of bytes read is returned, or a negative number on failure (in which case errno will be set). If the call is interrupted, then errno will be EINTR, and the client should arrange for re-starting the read if necessary.

Definition at line 28 of file op_deviceio.c.

Referenced by opd_do_read(), and opd_shutdown().

Here is the caller graph for this function:


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1