mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
add isastream (obsolete STREAMS junk)
apparently some packages see stropts.h and want to be able to use this. the implementation checks that the file descriptor is valid by using fcntl/F_GETFD so it can report an error if not (as specified).
This commit is contained in:
parent
98c9af5001
commit
106e75f712
2 changed files with 9 additions and 1 deletions
|
@ -129,7 +129,8 @@ struct str_list {
|
|||
struct str_mlist *sl_modlist;
|
||||
};
|
||||
|
||||
int ioctl (int, int, ...);
|
||||
int isastream(int);
|
||||
int ioctl(int, int, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
7
src/misc/isastream.c
Normal file
7
src/misc/isastream.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <stropts.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int isastream(int fd)
|
||||
{
|
||||
return fcntl(fd, F_GETFD) < 0 ? -1 : 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue