mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 02:35:03 +01:00
parent
a74f88cf8f
commit
26740b2889
@ -20,6 +20,7 @@
|
||||
#define F_GETLK 0x0020 /* get locking information */
|
||||
#define F_SETLK 0x0080 /* set locking information */
|
||||
#define F_SETLKW 0x0100 /* as above, but waits if blocked */
|
||||
#define F_DUPFD_CLOEXEC 0x0200 /* duplicate fd with close on exec set */
|
||||
|
||||
/* advisory locking types */
|
||||
#define F_RDLCK 0x0040 /* read or shared lock */
|
||||
|
@ -6147,13 +6147,14 @@ common_fcntl(int fd, int op, size_t argument, bool kernel)
|
||||
break;
|
||||
|
||||
case F_DUPFD:
|
||||
case F_DUPFD_CLOEXEC:
|
||||
{
|
||||
struct io_context* context = get_current_io_context(kernel);
|
||||
|
||||
status = new_fd_etc(context, descriptor, (int)argument);
|
||||
if (status >= 0) {
|
||||
mutex_lock(&context->io_mutex);
|
||||
fd_set_close_on_exec(context, fd, false);
|
||||
fd_set_close_on_exec(context, fd, op == F_DUPFD_CLOEXEC);
|
||||
mutex_unlock(&context->io_mutex);
|
||||
|
||||
atomic_add(&descriptor->ref_count, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user