UMASK.2
Upload User: jnzhq888
Upload Date: 2007-01-18
Package Size: 51694k
Code Size: 1k
Category:

OS Develop

Development Platform:

WINDOWS

  1. ." Copyright (c) 1980 Regents of the University of California.
  2. ." All rights reserved.  The Berkeley software License Agreement
  3. ." specifies the terms and conditions for redistribution.
  4. ."
  5. ." @(#)umask.2 6.1 (Berkeley) 5/9/85
  6. ."
  7. .TH UMASK 2 "May 9, 1985"
  8. .UC 4
  9. .SH NAME
  10. umask - set file creation mode mask
  11. .SH SYNOPSIS
  12. .nf
  13. .ft B
  14. #include <sys/types.h>
  15. #include <sys/stat.h>
  16. mode_t umask(mode_t fImaskfP)
  17. .ft R
  18. .fi
  19. .SH DESCRIPTION
  20. .B Umask
  21. sets the process's file mode creation mask to fImaskfP
  22. and returns the previous value of the mask.  The low-order
  23. 9 bits of fImaskfP are used whenever a file is created,
  24. clearing corresponding bits in the file mode
  25. (see
  26. .BR chmod (2)).
  27. This clearing allows each user to restrict the default access
  28. to his files.
  29. .PP
  30. The value is initially 022 (write access for owner only).
  31. The mask is inherited by child processes.
  32. .SH "RETURN VALUE
  33. The previous value of the file mode mask is returned by the call.
  34. .SH SEE ALSO
  35. .BR chmod (2),
  36. .BR mknod (2),
  37. .BR open (2).