Logo
Explore Help
Sign In
fluencelabs/musl
1
0
Fork 0
You've already forked musl
mirror of https://github.com/fluencelabs/musl synced 2025-06-01 00:51:41 +00:00
Code Issues Projects Releases Wiki Activity
musl/src/unistd/dup2.c

11 lines
178 B
C
Raw Normal View History

initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
#include <unistd.h>
workaround bug in linux dup2 the linux documentation for dup2 says it can fail with EBUSY due to a race condition with open and dup in the kernel. shield applications (and the rest of libc) from this nonsense by looping until it succeeds
2011-04-20 21:05:10 -04:00
#include <errno.h>
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
#include "syscall.h"
int dup2(int old, int new)
{
workaround bug in linux dup2 the linux documentation for dup2 says it can fail with EBUSY due to a race condition with open and dup in the kernel. shield applications (and the rest of libc) from this nonsense by looping until it succeeds
2011-04-20 21:05:10 -04:00
int r;
while ((r=__syscall(SYS_dup2, old, new))==-EBUSY);
return __syscall_ret(r);
initial check-in, version 0.5.0
2011-02-12 00:22:29 -05:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 511ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API