aboutsummaryrefslogtreecommitdiff
path: root/libbb/xfuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/xfuncs.c')
-rw-r--r--libbb/xfuncs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index d02ef9c77..7803afcec 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -158,6 +158,7 @@ void xunlink(const char *pathname)
158 bb_perror_msg_and_die("can't remove file '%s'", pathname); 158 bb_perror_msg_and_die("can't remove file '%s'", pathname);
159} 159}
160 160
161#ifndef __MINGW32__
161// Turn on nonblocking I/O on a fd 162// Turn on nonblocking I/O on a fd
162int ndelay_on(int fd) 163int ndelay_on(int fd)
163{ 164{
@@ -168,6 +169,7 @@ int ndelay_off(int fd)
168{ 169{
169 return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL,0) & ~O_NONBLOCK); 170 return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL,0) & ~O_NONBLOCK);
170} 171}
172#endif
171 173
172// "Renumber" opened fd 174// "Renumber" opened fd
173void xmove_fd(int from, int to) 175void xmove_fd(int from, int to)
@@ -224,6 +226,7 @@ void xfflush_stdout(void)
224 } 226 }
225} 227}
226 228
229#ifndef __MINGW32__
227void sig_block(int sig) 230void sig_block(int sig)
228{ 231{
229 sigset_t ss; 232 sigset_t ss;
@@ -264,6 +267,7 @@ void sig_pause(void)
264 sigemptyset(&ss); 267 sigemptyset(&ss);
265 sigsuspend(&ss); 268 sigsuspend(&ss);
266} 269}
270#endif
267 271
268 272
269void xsetenv(const char *key, const char *value) 273void xsetenv(const char *key, const char *value)
@@ -387,6 +391,7 @@ char *bin2hex(char *p, const char *cp, int count)
387 return p; 391 return p;
388} 392}
389 393
394#ifndef __MINGW32__
390// Die with an error message if we can't set gid. (Because resource limits may 395// Die with an error message if we can't set gid. (Because resource limits may
391// limit this user to a given number of processes, and if that fills up the 396// limit this user to a given number of processes, and if that fills up the
392// setgid() will fail and we'll _still_be_root_, which is bad.) 397// setgid() will fail and we'll _still_be_root_, which is bad.)
@@ -440,7 +445,7 @@ off_t fdlength(int fd)
440 445
441 return pos + 1; 446 return pos + 1;
442} 447}
443 448#endif
444// Die with an error message if we can't malloc() enough space and do an 449// Die with an error message if we can't malloc() enough space and do an
445// sprintf() into that space. 450// sprintf() into that space.
446char *xasprintf(const char *format, ...) 451char *xasprintf(const char *format, ...)
@@ -612,6 +617,7 @@ void selinux_or_die(void)
612 617
613/* It is perfectly ok to pass in a NULL for either width or for 618/* It is perfectly ok to pass in a NULL for either width or for
614 * height, in which case that value will not be set. */ 619 * height, in which case that value will not be set. */
620#ifndef __MINGW32__
615int get_terminal_width_height(const int fd, int *width, int *height) 621int get_terminal_width_height(const int fd, int *width, int *height)
616{ 622{
617 struct winsize win = { 0, 0, 0, 0 }; 623 struct winsize win = { 0, 0, 0, 0 };
@@ -639,3 +645,4 @@ int get_terminal_width_height(const int fd, int *width, int *height)
639 645
640 return ret; 646 return ret;
641} 647}
648#endif