Back to index

glibc  2.9
ptsname.c File Reference
#include <errno.h>
#include <string.h>
#include <hurd.h>
#include <hurd/fd.h>
#include <hurd/term.h>

Go to the source code of this file.


char * ptsname (int fd)
int __ptsname_r (int fd, char *buf, size_t buflen)

Function Documentation

int __ptsname_r ( int  fd,
char *  buf,
size_t  buflen 

Definition at line 48 of file ptsname.c.

  char peername[1024];  /* XXX */
  size_t len;
  error_t err;

  peername[0] = '\0';
  if (err = HURD_DPORT_USE (fd, __term_get_peername (port, peername)))
    return _hurd_fd_error (fd, err);

  len = strlen (peername) + 1;
  if (len > buflen)
    return ERANGE;

  memcpy (buf, peername, len);
  return 0;

Here is the call graph for this function:

char* ptsname ( int  fd)

Definition at line 31 of file ptsname.c.

  static char peername[1024];  /* XXX */
  error_t err;

  err = __ptsname_r (fd, peername, sizeof (peername));
  if (err)
    __set_errno (err);

  return err ? NULL : peername;

Here is the call graph for this function: