Add (POSIX defined) struct flock

struct flock is posix defined locking mechanism on *nix platform

Example usage (copied from https://gavv.github.io/articles/file-locks/) :

  #include <fcntl.h>

  struct flock fl;
  memset(&fl, 0, sizeof(fl));

  // lock in shared mode
  fl.l_type = F_RDLCK;

  // lock entire file
  fl.l_whence = SEEK_SET; // offset base is start of the file
  fl.l_start = 0;         // starting offset is zero
  fl.l_len = 0;           // len is zero, which is a special value representing end
                        // of file (no matter how large the file grows in future)

  fl.l_pid = 0; // F_SETLK(W) ignores it; F_OFD_SETLK(W) requires it to be zero

  // F_SETLKW specifies blocking mode
  if (fcntl(fd, F_SETLKW, &fl) == -1) {
    exit(1);
  }

  // atomically upgrade shared lock to exclusive lock, but only
  // for bytes in range [10; 15)
  //
  // after this call, the process will hold three lock regions:
  //  [0; 10)        - shared lock
  //  [10; 15)       - exclusive lock
  //  [15; SEEK_END) - shared lock
  fl.l_type = F_WRLCK;
  fl.l_start = 10;
  fl.l_len = 5;

  // F_SETLKW specifies non-blocking mode
  if (fcntl(fd, F_SETLK, &fl) == -1) {
      exit(1);
  }

  // release lock for bytes in range [10; 15)
  fl.l_type = F_UNLCK;

  if (fcntl(fd, F_SETLK, &fl) == -1) {
      exit(1);
  }

  // close file and release locks for all regions
  // remember that locks are released when process calls close()
  // on any descriptor for a lock file
  close(fd);
5 jobs for elf_And_flock in 28 minutes and 53 seconds (queued for 9 minutes and 53 seconds)
latest
Status Job ID Name Coverage
  Build
passed #27630
build:linux

00:12:05

passed #27631
build:redox

00:07:16

 
  Test
failed #27634
allowed to fail
fmt

00:00:59

failed #27632
test:linux

00:04:25

failed #27633
test:redox

00:09:31

 
Name Stage Failure
failed
test:redox Test
redoxer: copying '.' to '/root'
qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory

## redoxer (failure, qemu exit status ExitStatus(ExitStatus(256)) ##
error: test failed, to rerun pass '--lib'
redoxer cargo: exit code: 2
make: *** [test] Error 1
Makefile:92: recipe for target 'test' failed
ERROR: Job failed: exit code 1
failed
test:linux Test
failures:
platform::test::access

test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--lib'
Makefile:92: recipe for target 'test' failed
make: *** [test] Error 101
ERROR: Job failed: exit code 1
failed
fmt Test
+    assert_eq!(
+ inet_aton(raw_addr.as_ptr() as *mut i8, &mut addr),
+ 1,
+ "inet_aton might be broken, failed to parse netstack address"
+ );

let ret = sockaddr_in {
sin_family: AF_INET as sa_family_t,
ERROR: Job failed: exit code 1