Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 82708 Details for
Bug 127000
ptsname system call is supposed to return a (char*), but it does not.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Tiny example program extracted from xconsole
ptsname-bug.c (text/plain), 942 bytes, created by
Ferris McCormick (RETIRED)
on 2006-03-20 12:55:35 UTC
(
hide
)
Description:
Tiny example program extracted from xconsole
Filename:
MIME Type:
Creator:
Ferris McCormick (RETIRED)
Created:
2006-03-20 12:55:35 UTC
Size:
942 bytes
patch
obsolete
>#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#define _SZ 1024 >static const char * PTC = "/dev/ptmx"; >static int pty; >static char *ptc; >static char BUF[_SZ]; >int >main(int argc, char* argv[]) { > int i; > for (i=0; i < _SZ; ++i) BUF[i]= (char)NULL; > pty = open(PTC,O_RDONLY); > if(pty < 0) { > fprintf(stderr,"Can't open %s read-only\n", PTC); > return (-1); > } else { > fprintf(stderr, "%s is open with descr = %d\n", PTC, pty); > } > /* ptc = ptsname(pty); > * */ >#ifdef SEG_FAULT > ptc = ptsname(pty); > if(ptc == NULL) { >#else > ptc = ptsname_r(pty, BUF, _SZ); > if(ptc != NULL) { >#endif > fprintf(stderr, "Can't get name for %s(%d)\n", PTC, pty); > return (-1); > } > fprintf(stderr, "fd %d gets pseudo-terminal pointer %x\n", pty, ptc); >#ifdef SEG_FAULT > strcpy(BUF, ptc); >#endif > fprintf(stderr,"Pseudo-terminal is %s\n", BUF); > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 127000
: 82708 |
82709