Add script.com and whois.com courtesy of FreeBSD

This commit is contained in:
Justine Tunney 2022-09-13 20:11:09 -07:00
parent 654ceaba7d
commit 1ad2f530f9
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
33 changed files with 1735 additions and 265 deletions

View file

@ -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;
}