YedFileMan - Fuser

NAME:
Fuser

SYNOPSIS:
SINT Fuser(void *pvO,SCHAR *pscName,SINT siNop,struct F_user *pData,
           SINT siNumElemData);

DESCRIPTION:
The method reads and returns pids of processes using file pscName, through buffer pData. If the number of processes attached to pscName is greater than siNumElemData, storing of process data in buffer pData is stopped, but the function returns in any case the real number of processes. The parameter siNop is not used; it's here only for compatibility with the equivalent DEC-COMPAQ TRU64 UNIX function interface, but implementations are not equivalent. The pData buffer must be allocated before passing it to the method and must have siNumElemData items; struct F_user is a structure containing only PID of single instance, in fu_pid field. pvO is a pointer to the object instance invoking this method.
To get its data, the method uses a "dangerous" popen of the fuser shell command.

RETURN VALUE:
The method returns the number of processes using pscName. In case of error, it returns:

YFINVALIDSOURCE
pscName is incorrect: maybe it's 0-length buffer, or NULL pointer.

YFPOPENERROR
Error in calling 'popen' function with /sbin/fuser input command.

 


http://yed.sourceforge.net