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

  man pages->NetBSD man pages -> getmode (3)              
Title
Content
Arch
Section
 

SETMODE(3)

Contents


NAME    [Toc]    [Back]

     getmode, setmode - modify mode bits

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <unistd.h>

     mode_t
     getmode(const void *set, mode_t mode);

     void *
     setmode(const char *mode_str);

DESCRIPTION    [Toc]    [Back]

     The getmode() function returns a copy of the file permission bits mode as
     altered by the values pointed to by set.  While only the mode bits are
     altered, other parts of the file mode may be examined.

     The setmode() function takes an absolute (octal) or symbolic value, as
     described in chmod(1), as an argument and returns a pointer to mode values
 to be supplied to getmode().  Because some of the symbolic values are
     relative to the file creation mask, setmode() may call umask(2).  If this
     occurs, the file creation mask will be restored before setmode() returns.
     If the calling program changes the value of its file creation mask after
     calling setmode(), setmode() must be called again if getmode() is to modify
 future file modes correctly.

     If the mode passed to setmode() is invalid, setmode() returns NULL.

ERRORS    [Toc]    [Back]

     The setmode() function may fail and set errno for any of the errors specified
 for the library routine malloc(3).

SEE ALSO    [Toc]    [Back]

      
      
     chmod(1), stat(2), umask(2), malloc(3)

HISTORY    [Toc]    [Back]

     The getmode() and setmode() functions first appeared in 4.4BSD.

BSD                             April 28, 1995                             BSD
[ Back ]
 Similar pages
Name OS Title
pmap_set_modify Tru64 General: Sets the modify bits of the specified physical page
doublebuffer IRIX sets the display mode to double buffer mode
cmode IRIX sets color map mode as the current mode.
unicode_stop Linux put the console out of unicode mode (ie. in 8-bit mode).
encrypt Linux Encrypt 64 bits messages
popcnt IRIX Counts number of set bits
swritemask IRIX specify which stencil bits can be written
strip Tru64 Removes symbols and relocation bits
strip IRIX remove symbols and relocation bits
leadz IRIX Counts number of leading 0 bits
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service