Skip to content

Commit

Permalink
options/posix: fcntl.h: guard GNU extension behind _GNU_SOURCE
Browse files Browse the repository at this point in the history
  • Loading branch information
ikbenlike committed Aug 4, 2023
1 parent 706007d commit ca133ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions options/posix/include/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,28 @@ int posix_fallocate(int, off_t, off_t);

// This is a linux extension

#ifdef _GNU_SOURCE

struct file_handle {
unsigned int handle_bytes;
int handle_type;
unsigned char f_handle[0];
};

#endif /* _GNU_SOURCE */

#ifndef __MLIBC_ABI_ONLY

#ifdef _GNU_SOURCE

int name_to_handle_at(int, const char *, struct file_handle *, int *, int);
int open_by_handle_at(int, struct file_handle *, int);

ssize_t splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned int flags);
ssize_t vmsplice(int fd, const struct iovec *iov, size_t nr_segs, unsigned int flags);

#endif /* _GNU_SOURCE */

#endif /* !__MLIBC_ABI_ONLY */

#define SPLICE_F_MOVE 1
Expand Down

0 comments on commit ca133ca

Please sign in to comment.