mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
![Linus Groh](/assets/img/avatar_default.png)
Only keep track of that (and eventually close() it) internally instead. This argument is not present on other systems, so we were running into compatibility issues with ports. Also bring the implementation closer to Linux and OpenBSD by making sure to close the slave pty fd in the fork()'d child as well as _exit()'ing on login_tty() failure - it's non-POSIX, so those are our references here. :^)
19 lines
433 B
C
19 lines
433 B
C
/*
|
|
* Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <sys/cdefs.h>
|
|
#include <termios.h>
|
|
|
|
__BEGIN_DECLS
|
|
|
|
int openpty(int* amaster, int* aslave, char* name, const struct termios* termp, const struct winsize* winp);
|
|
pid_t forkpty(int* amaster, char* name, const struct termios* termp, const struct winsize* winp);
|
|
int login_tty(int fd);
|
|
|
|
__END_DECLS
|