*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> fuser (2)              



NAME    [Toc]    [Back]

       fuser  -  Reports  PIDs  and  UIDs for files, file systems
       and/or the devices attached to them.

SYNOPSIS    [Toc]    [Back]

       #include <sys/fuser.h>

       int fuser(
               char *file,
               long flag,
               struct f_user fuser_array[],
               long sizeof_fuser_array );

PARAMETERS    [Toc]    [Back]

       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.  Matches deleted
       files on the mount point specified by file.  Specifies the
       array.   Specifies  the  number  of  elements in the fuser

DESCRIPTION    [Toc]    [Back]

       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 attached 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.   Executable  image.  Controlling terminal Trace At
       least one file is mmapped

RETURN VALUES    [Toc]    [Back]

       On success, the  fuser  function  returns  the  number  of
       fuser_array  elements 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.

ERRORS    [Toc]    [Back]

       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 elements returned or the array
       structure cannot be filled The  file  parameter  specified
       does not exist

EXAMPLES    [Toc]    [Back]

       Open regular files and special files are matched using the
       flag parameter 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  associated  with  the
       home/try file are reported as in the following example:

              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

[ Back ]
 Similar pages
Name OS Title
cpusetGetPIDList IRIX get a list of all PIDs attached to a cpuset
locks Tru64 A directory that contains lock files for communication devices and remote systems that prevent multi...
setup Linux setup devices and file systems, mount root file system
pnpinfo FreeBSD reports information about Plug-n-Play ISA devices
pidlock NetBSD locks based on files containing PIDs
ttylock NetBSD locks based on files containing PIDs
ttyunlock NetBSD locks based on files containing PIDs
xmesh Tru64 Reports utilization percentages of EV7 based AlphaServer systems mesh components.
filterlog Tru64 Logs and reports system Correctable Read Data (CRD) memory errors on specific systems.
rrestore OpenBSD restore files or file systems from backups made with dump
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service