0

I am trying to learn more about Linux on the systemcall/interface level. Starting with limits, I read in APUE that limits such as _POSIX_OPEN_MAX are symbols. After googling, I read these symbols are in libraries. How do I find which library would have the _POSIX_OPEN_MAX symbol? I did find the header files with the limits, but I would like to learn how locate these in the compiled GNU libraries on my Linux System(using nm?). There are so many libraries I would not know where to begin to map out where these symbols would be.

dman
  • 10,406
  • 18
  • 102
  • 201

1 Answers1

1

_POSIX_OPEN_MAX is a macro and is replaced at compile time. In most cases, all information about macros is discarded after preprocessing, and so there is no symbol as such.

It is possible to make gcc include information about macros by using the -gdwarf-2 and -g3 flags, but it's very unlikely these options were used when building your system libraries. So, in short, you most likely won't find it in any of them.

FatalError
  • 52,695
  • 14
  • 99
  • 116
  • This makes sense to me also. But my APUE book calls these symbols when using it's AWK program to detect them in pathconf.sym and sysconf.sym. (in the limits section 2.5). – dman Mar 09 '13 at 07:47