| author | |
| committer | |
| log | 56507ecf9849719356bb36ed8e5dc539cd060a36 |
| tree | 7d054d765cd7b151043e265114a33e0d55bb2566 |
| parent | 746dd51fafa8cdc8d98500af3b3b4b659c1aef92 |
`isastream` is an old, deprecated function for the STREAMS framework.
Linux doesn't even support this natively, and so the musl implementation
just returns 0 (not a STREAMS file) for valid file descriptors or -1
(for bad file descriptors).4 files changed, 18 insertions(+), 8 deletions(-)
lib/c.zig+1| ... | @@ -73,6 +73,7 @@ comptime { | ... | @@ -73,6 +73,7 @@ comptime { |
| 73 | _ = @import("c/stdlib.zig"); | 73 | _ = @import("c/stdlib.zig"); |
| 74 | _ = @import("c/string.zig"); | 74 | _ = @import("c/string.zig"); |
| 75 | _ = @import("c/strings.zig"); | 75 | _ = @import("c/strings.zig"); |
| 76 | _ = @import("c/stropts.zig"); | ||
| 76 | 77 | ||
| 77 | _ = @import("c/sys/capability.zig"); | 78 | _ = @import("c/sys/capability.zig"); |
| 78 | _ = @import("c/sys/file.zig"); | 79 | _ = @import("c/sys/file.zig"); |
lib/c/stropts.zig created+17| ... | @@ -0,0 +1,17 @@ | ||
| 1 | const builtin = @import("builtin"); | ||
| 2 | |||
| 3 | const std = @import("std"); | ||
| 4 | const linux = std.os.linux; | ||
| 5 | |||
| 6 | const symbol = @import("../c.zig").symbol; | ||
| 7 | const errno = @import("../c.zig").errno; | ||
| 8 | |||
| 9 | comptime { | ||
| 10 | if (builtin.target.isMuslLibC()) { | ||
| 11 | symbol(&isastream, "isastream"); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | fn isastream(fd: c_int) callconv(.c) c_int { | ||
| 16 | return if (errno(linux.fcntl(fd, linux.F.GETFD, 0)) < 0) -1 else 0; | ||
| 17 | } | ||
lib/libc/musl/src/legacy/isastream.c deleted-7| ... | @@ -1,7 +0,0 @@ | ||
| 1 | #include <stropts.h> | ||
| 2 | #include <fcntl.h> | ||
| 3 | |||
| 4 | int isastream(int fd) | ||
| 5 | { | ||
| 6 | 	return fcntl(fd, F_GETFD) < 0 ? -1 : 0; | ||
| 7 | } | ||
src/libs/musl.zig-1| ... | @@ -691,7 +691,6 @@ const src_files = [_][]const u8{ | ... | @@ -691,7 +691,6 @@ const src_files = [_][]const u8{ |
| 691 | "musl/src/legacy/getpagesize.c", | 691 | "musl/src/legacy/getpagesize.c", |
| 692 | "musl/src/legacy/getpass.c", | 692 | "musl/src/legacy/getpass.c", |
| 693 | "musl/src/legacy/getusershell.c", | 693 | "musl/src/legacy/getusershell.c", |
| 694 | "musl/src/legacy/isastream.c", | ||
| 695 | "musl/src/legacy/lutimes.c", | 694 | "musl/src/legacy/lutimes.c", |
| 696 | "musl/src/legacy/ulimit.c", | 695 | "musl/src/legacy/ulimit.c", |
| 697 | "musl/src/legacy/utmpx.c", | 696 | "musl/src/legacy/utmpx.c", |