lkml.org 
[lkml]   [1996]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: _SC_* gone?
ats@hubert.wustl.edu (Alan Shutko)  wrote on 25.07.96 in <199607260408.XAA03395@hubert.wustl.edu>:

> >>>>> "CP" == Carlos Puchol <cpg@cs.utexas.edu> writes:

CP>> /* The following table is generated from all _SC_ values * in
CP>> unistd.h.

> Taking a look at <unistd.h>, I see:
>
> /* Get the `_PC_*' symbols for the NAME argument to `pathconf' and
> `fpathconf'; the `_SC_*' symbols for the NAME argument to
> `sysconf'; and the `_CS_*' symbols for the NAME argument to
> `confstr'. */
> #include <confname.h>
>
> Evidently, the sml tries to pull the values out, but doesn't follow
> the include. Even if they did, it probably wouldn't have worked
> since confname.h uses an enum to define them. I'm not sure how you
> could get them in an automated way....

Easy. Write a C program that #includes <unistd.h> (that is, it gets the
definitions the standard C way) and outputs whatever syntax you prefer,
like for exampel so:

#include <unistd.h>
#include <stdio.h>

main()
{
printf("_SC_OPEN_MAX = %d\n", (int)_SC_OPEN_MAX);
}

If you want to get at standardized constant definitions, that is a very
portable way to do it. It's a lot easier to get right than going through
the include files yourself.


MfG Kai


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.032 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site