In the standard library (glibc) I see functions defined with leading double underscores, such as __mmap
in sys/mman.h
. What is the purpose? And how can we still call a function mmap
which doesn't seem to be declared anywhere. I mean we include sys/mman.h
for that, but sys/mman.h
doesn't declare mmap
, it declares only __mmap
.
相关问题
- Multiple sockets for clients to connect to
- Is shmid returned by shmget() unique across proces
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- how to get running process information in java?
Names with leading double underscore are reserved for internal use by the implementation (compiler/standard library/etc.). They should never appear in your code. The purpose of this reserved namespace is to give the system headers names they can use without potentially clashing with names used in your program.
ISO 9899:2011
From GNU's manual:
This is a convention which is also used by C and C++ vendors.