2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
11 #include <SupportDefs.h>
17 posix_openpt(int openFlags
)
19 return open("/dev/ptmx", openFlags
);
26 return ioctl(masterFD
, B_IOCTL_GRANT_TTY
);
34 if (ioctl(masterFD
, B_IOCTL_GET_TTY_INDEX
, &index
, sizeof(index
)) < 0)
37 static char buffer
[32];
40 snprintf(buffer
, sizeof(buffer
), "/dev/tt/%c%" B_PRIx32
,
41 char(letter
+ index
/ 16), index
% 16);
48 unlockpt(int masterFD
)