* fdopen() Bug
@ 1994-06-09 20:02 Cy Schubert - BCSC Open Systems Group
0 siblings, 0 replies; only message in thread
From: Cy Schubert - BCSC Open Systems Group @ 1994-06-09 20:02 UTC (permalink / raw)
Has anoyone come across a bug in fdopen() where it complains about a vaild
argument list and core dumps? Here is a sample program. Is a fix available?
#include <stdio.h>
#include <sys/fcntl.h>
#include <errno.h>
main()
{
FILE *lockfile;
int lockfd, i;
char hostname[80];
lockfd = open("xyz", O_CREAT , S_IRUSR | S_IWUSR);
lockfile = fdopen(lockfd, "r");
perror("error at fdopen:");
printf("%d %d\n",lockfd,lockfile);
gethostname(hostname, sizeof(hostname));
fprintf(lockfile, "%s %d\n", hostname, getpid());
fclose(lockfile);
return 0;
close(lockfd);
}
Regards, Phone: (604)389-3827
Cy Schubert OV/VM: BCSC02(CSCHUBER)
Open Systems & MVS Support BITNET: CSCHUBER@BCSC02.BITNET
BC Systems Corp. Internet: cschuber@bcsc02.gov.bc.ca
cschuber@uumail.gov.bc.ca
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1994-06-09 20:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-06-09 20:02 fdopen() Bug Cy Schubert - BCSC Open Systems Group
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox