LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-13-2012, 12:21 PM   #1
corone
Member
 
Registered: Jul 2009
Posts: 46

Rep: Reputation: 1
What does /proc/PID/auxv mean exactly?


Code:
# hexdump -Cv /proc/1/auxv
00000000  20 00 00 00 14 64 81 b7  21 00 00 00 00 60 81 b7  | ....d..!....`..|
00000010  10 00 00 00 ff fb eb 0f  06 00 00 00 00 10 00 00  |................|
00000020  11 00 00 00 64 00 00 00  03 00 00 00 34 80 04 08  |....d.......4...|
00000030  04 00 00 00 20 00 00 00  05 00 00 00 07 00 00 00  |.... ...........|
00000040  07 00 00 00 00 70 81 b7  08 00 00 00 00 00 00 00  |.....p..........|
00000050  09 00 00 00 30 9a 04 08  0b 00 00 00 00 00 00 00  |....0...........|
00000060  0c 00 00 00 00 00 00 00  0d 00 00 00 00 00 00 00  |................|
00000070  0e 00 00 00 00 00 00 00  17 00 00 00 00 00 00 00  |................|
00000080  19 00 00 00 9b 48 9a bf  1f 00 00 00 f1 4f 9a bf  |.....H.......O..|
00000090  0f 00 00 00 ab 48 9a bf  00 00 00 00 00 00 00 00  |.....H..........|
000000a0
All of processes have auxv information.

I found out that auxv means AUXiliary Vector.
This contains the contents of the ELF interpreter information passed to the process at exec time.
The values are those that were passed by the operating system as startup information to the dynamic linker.
These vectors are the mechanism to transfer some OS specific information to the program interpreter (e.g. ld) and the process.

The format is one unsigned long ID plus one unsigned long value for each entry. (according to man proc)
Then,
Code:
00000020 b7816414
00000021 b7816000
00000010 0febfbff
00000006 00001000
... ...
So... what does this values exactly mean ?

Last edited by corone; 08-15-2012 at 10:22 PM.
 
Old 08-14-2012, 09:02 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173Reputation: 3173
/proc, among others, is a "fake" file/directory system. When you "list the files and directories in" this area, and when you read/write the files you find there, you are actually communicating directly with the Linux kernel. In this case, about process #1, although the information to be found here is not strictly about "processes." The information that you find here varies considerably, and it can be just as esoteric as this. It's not just "the only way" to get this kind of info; it is an elegant way.

Last edited by sundialsvcs; 08-14-2012 at 09:03 AM.
 
Old 08-14-2012, 09:18 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Code:
00000020 b7816414
00000021 b7816000
00000010 0febfbff
00000006 00001000
... ...
So... what does this values exactly mean ?

0x20, 0x21, 0x10, 0x06 are specify type of AUXV parameter, other numbers - their values.
For the list of AUXV parameter types you can have a look at /usr/include/elf.h

Parts from this files:
Code:
#define AT_PAGESZ       6               /* System page size */

#define AT_HWCAP        16              /* Machine dependent hints about
                                           processor capabilities.  */


/* Pointer to the global system page used for system calls and other
   nice things.  */
#define AT_SYSINFO      32
#define AT_SYSINFO_EHDR 33
Please note, that your values are in hex and defines are decimal.

Also there is a interesting environment variable LD_SHOW_AUXV:
Code:
[valery@Fedora ~]$ LD_SHOW_AUXV=1 /bin/dd 
AT_SYSINFO_EHDR: 0x7fff2a3ff000
AT_HWCAP:        bfebf3ff
AT_PAGESZ:       4096
AT_CLKTCK:       100
AT_PHDR:         0x400040
AT_PHENT:        56
AT_PHNUM:        8
AT_BASE:         0x0
AT_FLAGS:        0x0
AT_ENTRY:        0x401a70
AT_UID:          500
AT_EUID:         500
AT_GID:          500
AT_EGID:         500
AT_SECURE:       0
AT_RANDOM:       0x7fff2a3a8179
AT_EXECFN:       /bin/dd
AT_PLATFORM:     x86_64
See man ld.so for more details
 
2 members found this post helpful.
Old 08-15-2012, 10:28 AM   #4
corone
Member
 
Registered: Jul 2009
Posts: 46

Original Poster
Rep: Reputation: 1
Thank you.

Thank you for your answer.

It's PERFECT. THANK YOU.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Print all PID folders from /proc line-by-line with this format (( PID: command-line )) courteous Linux - Newbie 7 12-12-2010 05:47 PM
pmap or /proc/<pid>smap or /proc/<pid>/status iQoder Linux - Newbie 1 07-16-2009 07:32 PM
/proc/pid/maps Moraxus Linux - General 0 02-11-2009 09:49 AM
/proc/<pid>/stat empty? Brian Moffet Linux - Kernel 1 04-27-2008 03:05 AM
/proc/pid/io seems not to work kornelix Linux - Server 5 06-17-2007 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration