Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Nov 2019 14:11:08 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354787 - head/lib/libc/gen
Message-ID:  <201911171411.xAHEB8HV039740@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Nov 17 14:11:08 2019
New Revision: 354787
URL: https://svnweb.freebsd.org/changeset/base/354787

Log:
  Document required size of buffer for elf_aux_info(3).
  
  PR:	241884
  Reported by:	jbeich
  Reviewed by:	brooks
  Sponsored by:	The FreeBSD Foundation
  MFC after:	3 days
  Differential revision:	https://reviews.freebsd.org/D22380

Modified:
  head/lib/libc/gen/auxv.3

Modified: head/lib/libc/gen/auxv.3
==============================================================================
--- head/lib/libc/gen/auxv.3	Sun Nov 17 14:08:19 2019	(r354786)
+++ head/lib/libc/gen/auxv.3	Sun Nov 17 14:11:08 2019	(r354787)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 13, 2019
+.Dd November 17, 2019
 .Dt ELF_AUX_INFO 3
 .Os
 .Sh NAME
@@ -44,29 +44,41 @@ function retrieves the auxiliary info vector requested
 The information is stored into the provided buffer if it will fit.
 The following values, defined in
 .In sys/elf_common.h
-can be requested:
+can be requested (corresponding buffer sizes are specified in parenthesis):
 .Bl -tag -width AT_OSRELDATE
 .It AT_CANARY
-The canary value for SSP.
+The canary value for SSP (arbitrary sized buffer, as many bytes are
+returned as it fits into it, rest is zeroed).
 .It AT_EXECPATH
-The path of executed program.
+The path of executed program
+.Dv (MAXPATHLEN).
 This may not be present if the process was initialized by
 .Xr fexecve 2
 and the namecache no longer contains the file's name.
 .It AT_HWCAP
-CPU / hardware feature flags.
+CPU / hardware feature flags
+.Dv (sizeof(u_long)).
 .It AT_HWCAP2
-CPU / hardware feature flags.
+CPU / hardware feature flags
+.Dv (sizeof(u_long)).
 .It AT_NCPUS
-Number of CPUs.
+Number of CPUs
+.Dv (sizeof(int)).
 .It AT_OSRELDATE
-Kernel OSRELDATE.
+The
+.Dv OSRELDATE
+of the kernel or jail the program is running on
+.Dv (sizeof(int)).
 .It AT_PAGESIZES
-Vector of page sizes.
+Vector of page sizes (arbitrary sized buffer, as many elements of the
+.Dv pagesizes
+array are returned as it fits).
 .It AT_PAGESZ
-Page size in bytes.
+Page size in bytes
+.Dv (sizeof(int)).
 .It AT_TIMEKEEP
-Pointer to VDSO timehands (for library internal use).
+Pointer to VDSO timehands (for library internal use,
+.Dv sizeof(void *)).
 .El
 .Sh RETURN VALUES
 Returns zero on success, or an error number on failure.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911171411.xAHEB8HV039740>