diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-07 10:29:54 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-07-17 00:55:45 +0000 |
commit | 2dbe90c248cead9181188fae018773b1ab6eafca (patch) | |
tree | 0f96e54c8a3757be3a016379fd4e8132c434e1c1 /src/3rdparty/forkfd/forkfd.h | |
parent | 8485fe9af8582e1f1a8b83f5865ccaaf409eb103 (diff) |
forkfd: update the API to add a reading and closing function
Right now the two functions being added are just wrappers, but this will
allow us in the future to support FreeBSD and Linux's system calls that
do the equivalent of forkfd, but have slightly different semantics in
the actual getting of the information from the file descriptor.
See-Also: https://lkml.org/lkml/2015/3/12/1044
See-Also: http://www.freebsd.org/cgi/man.cgi?query=pdfork
Change-Id: Ia0aac2f09e9245339951ffff13c94acb5f4ff204
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/3rdparty/forkfd/forkfd.h')
-rw-r--r-- | src/3rdparty/forkfd/forkfd.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/3rdparty/forkfd/forkfd.h b/src/3rdparty/forkfd/forkfd.h index b3ffe2bff3..dcb36f9f33 100644 --- a/src/3rdparty/forkfd/forkfd.h +++ b/src/3rdparty/forkfd/forkfd.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2014 Intel Corporation +** Copyright (C) 2015 Intel Corporation ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,7 @@ #define FORKFD_H #include <fcntl.h> +#include <stdint.h> #include <unistd.h> // to get the POSIX flags #ifdef _POSIX_SPAWN @@ -41,7 +42,14 @@ extern "C" { #define FFD_CHILD_PROCESS (-2) +struct forkfd_info { + int32_t code; + int32_t status; +}; + int forkfd(int flags, pid_t *ppid); +int forkfd_wait(int ffd, forkfd_info *info, struct rusage *rusage); +int forkfd_close(int ffd); #ifdef _POSIX_SPAWN /* only for spawnfd: */ |