mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
Add script.com and whois.com courtesy of FreeBSD
This commit is contained in:
parent
654ceaba7d
commit
1ad2f530f9
33 changed files with 1735 additions and 265 deletions
|
@ -16,6 +16,27 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/calls/termios.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/sysv/consts/termios.h"
|
||||
|
||||
int grantpt(int fd) { return 0; }
|
||||
/**
|
||||
* Grants access to subordinate pseudoteletypewriter.
|
||||
*
|
||||
* @return 0 on success, or -1 w/ errno
|
||||
* @raise EBADF if fd isn't open
|
||||
* @raise EINVAL if fd is valid but not associated with pty
|
||||
* @raise EACCES if pseudoterminal couldn't be accessed
|
||||
*/
|
||||
int grantpt(int fd) {
|
||||
int rc;
|
||||
if (IsXnu()) {
|
||||
rc = sys_ioctl(fd, TIOCPTYGRANT);
|
||||
} else {
|
||||
rc = _isptmaster(fd);
|
||||
}
|
||||
STRACE("grantpt(%d) → %d% m", fd, rc);
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue