oslib: qemu_clear_cloexec
Define qemu_clear_cloexec, analogous to qemu_set_cloexec. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/1759332851-370353-4-git-send-email-steven.sistare@oracle.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
a9f9eee58b
commit
fe72a8073e
3 changed files with 22 additions and 0 deletions
|
|
@ -305,6 +305,15 @@ int qemu_socketpair(int domain, int type, int protocol, int sv[2])
|
|||
return ret;
|
||||
}
|
||||
|
||||
void qemu_clear_cloexec(int fd)
|
||||
{
|
||||
int f;
|
||||
f = fcntl(fd, F_GETFD);
|
||||
assert(f != -1);
|
||||
f = fcntl(fd, F_SETFD, f & ~FD_CLOEXEC);
|
||||
assert(f != -1);
|
||||
}
|
||||
|
||||
char *
|
||||
qemu_get_local_state_dir(void)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -219,6 +219,10 @@ void qemu_set_cloexec(int fd)
|
|||
{
|
||||
}
|
||||
|
||||
void qemu_clear_cloexec(int fd)
|
||||
{
|
||||
}
|
||||
|
||||
int qemu_get_thread_id(void)
|
||||
{
|
||||
return GetCurrentThreadId();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue