*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: fuser | Section: 2 | Source: Digital UNIX | File: fuser.2.gz
fuser(2) System Calls Manual fuser(2) NAME fuser - Reports PIDs and UIDs for files, file systems and/or the de- vices attached to them. SYNOPSIS #include <sys/fuser.h> int fuser ( char *file, long flag, struct f_user fuser_array[], long sizeof_fuser_array ); PARAMETERS Specifies the file name. Specifies one of the following values. If none of the following are values are specified, the default is to match open files. Matches only file ids. Provides mount point matching. Specifies the array. Specifies the number of elements in the fuser ar- ray. DESCRIPTION The fuser function reports a list of PIDs and UIDs that are associated with a specified file, file system, and/or the devices that are at- tached to them. The fuser function can report back additional information about "matches" by ORing one of the following constants that can be passed back in the member fu_flags: Current directory Current directory Parent of the current directory At least one file open, but the number open is not known. Controlling terminal Trace At least one file is mmapped EXAMPLES Open regular files and special files are matched using the flag parame- ter set at 0L. Thus, if process 127 and 3220 open the /home/try file simultaneously and the fuser function is active, the PIDs and UIDs as- sociated with the home/try file are reported as in the following exam- ple: fuser("/home/try", 0L, fuser_array, \ (long) (sizeof (fuser_array)/sizeof(fuser_array[0])); Similarly, if the special device file /dev/ttyp2 is open by process 32, then that PID and its associated UID are reported as in the following example: fuser("/dev/ttyp2", 0L, fuser_array, \ (long) (sizeof (fuser_array)/sizeof(fuser_array[0])); RETURN VALUES On success, the fuser function returns the number of fuser_array ele- ments that were found. The contents of the structure are as follows: typedef struct f_user { pid_t fu_pid; int fu_flags; uid_t fu_uid; } f_user_t; If an error has occurred, the fuser function returns -1 and sets errno to indicate the error. 2 ERRORS If the fuser function fails, errno may be set to one of the following values: The array is not large enough to hold the number of array ele- ments returned or the array structure cannot be filled The file parame- ter specified does not exist delim off fuser(2)

Navigation Options