[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fpathconf returns 127 on error
From: |
Nathan Straz |
Subject: |
fpathconf returns 127 on error |
Date: |
Mon, 19 Mar 2001 17:02:58 -0600 |
User-agent: |
Mutt/1.3.15i |
I'm doing some NEGATIVE testing on fpathconf() and I don't believe what
I'm seeing. Instead of getting -1 returned, I get 127. The man pages,
the info pages, and the source all say that -1 should be returned.
Below is a small test program that shows the type of thing I am trying.
Calling pathconf() with a non-existent path also returns 127.
I've tried this program on i386 and ia64, glibc 2.2.2, 2.1.2 and 2.1.3.
I've tried gcc and sgicc (Pro64). Am I doing something so trivially
wrong that I don't see it?
Script started on Mon Mar 19 16:55:03 2001
address@hidden /extra/code% ldd --version
ldd (GNU libc) 2.2.2
Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
address@hidden /extra/code% gcc --version
2.95.3
address@hidden /extra/code% uname -a
Linux maine 2.4.2 #1 Thu Feb 22 10:48:52 CST 2001 i686 unknown
address@hidden /extra/code% cat fpathconf.c
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
int main()
{
long ret;
ret = fpathconf(-1, _PC_LINK_MAX);
printf("%hhd, errno: %d %s\n", ret, errno, strerror(errno));
return ret;
}
address@hidden /extra/code% make fpathconf
cc fpathconf.c -o fpathconf
address@hidden /extra/code% ./fpathconf
127, errno: 9 Bad file descriptor
address@hidden /extra/code% exit
Script done on Mon Mar 19 16:55:40 2001
--
Nate Straz address@hidden
sgi, inc http://www.sgi.com/
Linux Test Project http://oss.sgi.com/projects/ltp/
- fpathconf returns 127 on error,
Nathan Straz <=