| 1 | #include "platform.h" |
| 2 | |
| 3 | static struct flock Posix_IO_FLock_flock; |
| 4 | |
| 5 | C_Errno_t(C_Int_t) Posix_IO_FLock_fcntl (C_Fd_t f, C_Int_t cmd) { |
| 6 | return fcntl (f, cmd, &Posix_IO_FLock_flock); |
| 7 | } |
| 8 | |
| 9 | C_Short_t Posix_IO_FLock_getType (void) { |
| 10 | return Posix_IO_FLock_flock.l_type; |
| 11 | } |
| 12 | |
| 13 | C_Short_t Posix_IO_FLock_getWhence (void) { |
| 14 | return Posix_IO_FLock_flock.l_whence; |
| 15 | } |
| 16 | |
| 17 | C_Off_t Posix_IO_FLock_getStart (void) { |
| 18 | return Posix_IO_FLock_flock.l_start; |
| 19 | } |
| 20 | |
| 21 | C_Off_t Posix_IO_FLock_getLen (void) { |
| 22 | return Posix_IO_FLock_flock.l_len; |
| 23 | } |
| 24 | |
| 25 | C_PId_t Posix_IO_FLock_getPId (void) { |
| 26 | return Posix_IO_FLock_flock.l_pid; |
| 27 | } |
| 28 | |
| 29 | void Posix_IO_FLock_setType (C_Short_t x) { |
| 30 | Posix_IO_FLock_flock.l_type = x; |
| 31 | } |
| 32 | |
| 33 | void Posix_IO_FLock_setWhence (C_Short_t x) { |
| 34 | Posix_IO_FLock_flock.l_whence = x; |
| 35 | } |
| 36 | |
| 37 | void Posix_IO_FLock_setStart (C_Off_t x) { |
| 38 | Posix_IO_FLock_flock.l_start = x; |
| 39 | } |
| 40 | |
| 41 | void Posix_IO_FLock_setLen (C_Off_t x) { |
| 42 | Posix_IO_FLock_flock.l_len = x; |
| 43 | } |
| 44 | |
| 45 | void Posix_IO_FLock_setPId (C_PId_t x) { |
| 46 | Posix_IO_FLock_flock.l_pid = x; |
| 47 | } |