Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/ttyname_r.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/ttyname_r.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/ttyname_r.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/ttyname_r.html on line 8
Get a fully qualified pathname for a file
#include <unistd.h>
int ttyname_r( int fildes,
char* name,
size_t namesize );
- fildes
- A file descriptor that's associated with the file whose name you want
to get.
- name
- A pointer to a buffer where the function can store the path name.
- namesize
- The size of the buffer.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The ttyname_r() function stores the null-terminated
pathname of the terminal associated with the file descriptor
fildes in the character array referenced by
name. The array is namesize characters long and
should have space for the name and the terminating NULL
character.
Zero for success, or an error number.
- EAGAIN
- The device driver was in use by another process, or the driver was
unable to carry out the request due to an outstanding command in progress.
- EBADF
- The fildes argument isn't a valid file descriptor.
- EINTR
- The function was interrupted by a signal.
- ENOSYS
- The ttyname_r() function
isn't implemented for the filesystem specified
by filedes.
- ENOTTY
- The fildes argument doesn't refer to a tty.
- EPERM
- The process doesn't have sufficient permission to carry out the requested
command.
- ERANGE
- The value of namesize is smaller than the length of the
string to be returned, including the terminating null character.
POSIX 1003.1 TSF
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
ctermid(),
errno,
setsid(),
ttyname()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/t/ttyname_r.html on line 168
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/t/ttyname_r.html on line 168