File:  [DVB] / dietlibc / libugly / grantpt.c
Revision 1.1: download - view: text, annotated - select for diffs
Mon Feb 18 19:53:17 2002 UTC (22 years, 3 months ago) by fefe
Branches: MAIN
CVS tags: finnland_test_200301, branch_rc14_fieldtest_finnland, branch_rc13_fieldtest_finnland, branch_rc12_fieldtest_finnland, branch_rc10_fieldtest_finnland, RELEASE_finnland_200301_1, RC12_FIELDTEST_FINNLAND, RC10_FIELDTEST_FINNLAND, HEAD
add x86 getenv, grantpt, ptsname and unlockpt from Thomas Ogrisegg
add prototypes in stdlib.h.
remove large commented out code from gethostent
fix parser bug for "search foo,bar" in /etc/resolv.conf

#define _XOPEN_SOURCE
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>

int grantpt (int fd) {
  struct stat st;
  if ((fstat(fd, &st))<0) return -1;
  if ((chmod((char*)ptsname(fd), st.st_mode | S_IRUSR | S_IWUSR | S_IWGRP))<0)
    return -1;
  return 0;
}

LinuxTV legacy CVS <linuxtv.org/cvs>