home *** CD-ROM | disk | FTP | other *** search
/ Software USA 4 #11 / Software USA Volume 4.11.iso / mac / Educational / mac06 / usr / include / fcntl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-18  |  878 b   |  47 lines  |  [TEXT/SPM ]

  1. /* mac06©1997 by HNS/DSITRI hns@computer.org
  2. ** fcntl.h
  3. */
  4.  
  5. #pragma once
  6.  
  7. #include "stdarg.h"
  8. #include "sys/types.h"
  9.  
  10. struct flock
  11.     {
  12.     short    l_type;
  13.     short    l_whence;
  14.     off_t    l_start;
  15.     off_t    l_len;
  16.     pid_t    l_pid;
  17.     };
  18.  
  19. #define F_DUPFD            0
  20. #define FD_CLOEXEC        0x0001
  21. #define F_GETFD            1
  22. #define F_SETFD            2
  23. #define F_GETFL            3
  24. #define F_SETFL            4
  25. #define F_GETLK            5
  26. #define F_SETLK            6
  27. #define F_SETLKW        7
  28. #define F_RDLCK            0x0001
  29. #define F_WRLCK            0x0002
  30. #define F_UNLCK            0x0003
  31.  
  32. #define O_APPEND        0x0020
  33. #define O_CREAT            0x0004
  34. #define O_EXCL            0x0010
  35. #define O_NOCTTY        0x0400
  36. #define O_NONBLOCK        0x0800
  37.  
  38. #define O_WRONLY        0x0001
  39. #define O_RDONLY        0x0002
  40. #define O_RDWR            (O_WRONLY|O_RDONLY)
  41. #define O_TRUNC            0x0008
  42.  
  43. int fcntl(int fd, int cmd, ...);
  44. int open(const char *name, int mode, ...);
  45. #define creat(name, mode) open((name), O_CREAT|O_TRUNC|O_WRONLY, (mode)) 
  46.  
  47. /* EOF */