Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102867959
D35209.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D35209.diff
View Options
Index: lib/libsysdecode/Makefile
===================================================================
--- lib/libsysdecode/Makefile
+++ lib/libsysdecode/Makefile
@@ -9,6 +9,7 @@
CFLAGS+= -I${.OBJDIR}
CFLAGS+= -I${SRCTOP}/sys
+CFLAGS+= -I${SRCTOP}/lib/libsysdecode
CFLAGS+= -I${SRCTOP}/libexec/rtld-elf
MAN= sysdecode.3 \
@@ -106,7 +107,7 @@
sysdecode_mask.3 sysdecode_wait4_options.3 \
sysdecode_mask.3 sysdecode_wait6_options.3
-CLEANFILES= ioctl.c ioctl.c.tmp tables.h
+CLEANFILES= ioctl.c ioctl.c.tmp tables.h ${.OBJDIR}/machine
.if defined(COMPAT_32BIT)
CPP+= -m32
@@ -122,8 +123,14 @@
CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}}
DEPENDOBJS+= tables.h
+DEPENDOBJS+= ${.OBJDIR}/machine
+
+${.OBJDIR}/machine:
+ rm -f ${.OBJDIR}/machine; \
+ ln -s ${SRCTOP}/sys/${MACHINE}/include ${.OBJDIR}/machine
+
tables.h: mktables
- sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET}
+ sh ${.CURDIR}/mktables ${MACHINE} ${SRCTOP}/sys ${.TARGET}
# mkioctls runs find(1) for headers so needs to rebuild every time. This used
# to be a hack only done in buildworld.
@@ -139,7 +146,7 @@
mv -f ${.TARGET}.tmp ${.TARGET}; \
fi
-beforedepend: ioctl.c tables.h
+beforedepend: ${.OBJDIR}/machine ioctl.c tables.h
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
Index: lib/libsysdecode/errno.c
===================================================================
--- lib/libsysdecode/errno.c
+++ lib/libsysdecode/errno.c
@@ -29,8 +29,8 @@
#include <sys/param.h>
#include <sys/acl.h>
#include <sys/wait.h>
-#include <errno.h>
-#include <limits.h>
+#include <sys/errno.h>
+#include <sys/limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <sysdecode.h>
Index: lib/libsysdecode/flags.c
===================================================================
--- lib/libsysdecode/flags.c
+++ lib/libsysdecode/flags.c
@@ -57,9 +57,9 @@
#include <ufs/ufs/quota.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
-#include <aio.h>
-#include <fcntl.h>
-#include <sched.h>
+#include <sys/aio.h>
+#include <sys/fcntl.h>
+#include <sys/sched.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
Index: lib/libsysdecode/mktables
===================================================================
--- lib/libsysdecode/mktables
+++ lib/libsysdecode/mktables
@@ -37,12 +37,13 @@
if [ -z "$1" ]
then
- echo "usage: sh $0 include-dir [output-file]"
+ echo "usage: sh $0 machine include-dir [output-file]"
exit 1
fi
-include_dir=$1
-if [ -n "$2" ]; then
- output_file="$2"
+machine=$1
+include_dir=$2
+if [ -n "$3" ]; then
+ output_file="$3"
output_tmp=$(mktemp -u)
exec > "$output_tmp"
fi
@@ -101,7 +102,7 @@
gen_table "flockops" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h"
gen_table "kldsymcmd" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
gen_table "kldunloadfflags" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
-gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h"
+gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "sys/aio.h"
gen_table "madvisebehav" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
gen_table "minheritflags" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
gen_table "mlockallflags" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
@@ -162,10 +163,10 @@
gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+((CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\))|(\(CAP_[A-Z_]+[[:space:]]*\|.*\)))" "sys/capsicum.h"
gen_table "sctpprpolicy" "SCTP_PR_SCTP_[A-Z_]+[[:space:]]+0x[0-9]+" "netinet/sctp_uio.h" "SCTP_PR_SCTP_ALL"
gen_table "cmsgtypesocket" "SCM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/socket.h"
-if [ -e "${include_dir}/x86/sysarch.h" ]; then
- gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h"
+if [ "$machine" == "amd64" ] || [ "$machine" == "i386" ]; then
+ gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/include/sysarch.h"
else
- gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "machine/sysarch.h"
+ gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "${machine}/include/sysarch.h"
fi
gen_table "shmflags" "SHM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/mman.h" "SHM_ANON"
Index: lib/libsysdecode/signal.c
===================================================================
--- lib/libsysdecode/signal.c
+++ lib/libsysdecode/signal.c
@@ -27,7 +27,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
-#include <signal.h>
+#include <sys/signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <sysdecode.h>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 5:13 AM (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14710850
Default Alt Text
D35209.diff (4 KB)
Attached To
Mode
D35209: libsysdecode: Using ${SRCTOP}/sys to generate tables.h
Attached
Detach File
Event Timeline
Log In to Comment