From e5392461315b7ca216627b5336c2f33b33119f28 Mon Sep 17 00:00:00 2001 From: Doug Coleman <doug.coleman@gmail.com> Date: Thu, 20 Mar 2008 15:11:27 -0500 Subject: [PATCH 1/4] fix stat on openbsd32 --- extra/unix/stat/openbsd/32/32.factor | 8 ++++---- extra/unix/stat/openbsd/64/64.factor | 2 +- extra/unix/stat/stat.factor | 3 ++- extra/unix/types/types.factor | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/extra/unix/stat/openbsd/32/32.factor b/extra/unix/stat/openbsd/32/32.factor index e4357ba70b..521735c9b4 100644 --- a/extra/unix/stat/openbsd/32/32.factor +++ b/extra/unix/stat/openbsd/32/32.factor @@ -12,9 +12,9 @@ C-STRUCT: stat { "gid_t" "st_gid" } { "dev_t" "st_rdev" } { "int32_t" "st_lspare0" } - { "timespec*" "st_atimespec" } - { "timespec*" "st_mtimespec" } - { "timespec*" "st_ctimespec" } + { "timespec*" "st_atim" } + { "timespec*" "st_mtim" } + { "timespec*" "st_ctim" } { "off_t" "st_size" } { "int64_t" "st_blocks" } { "u_int32_t" "st_blksize" } @@ -25,5 +25,5 @@ C-STRUCT: stat { "int64_t" "st_qspare1" } { "int64_t" "st_qspare2" } ; -! FUNCTION: int stat ( char* pathname, stat* buf ) ; +FUNCTION: int stat ( char* pathname, stat* buf ) ; FUNCTION: int lstat ( char* pathname, stat* buf ) ; diff --git a/extra/unix/stat/openbsd/64/64.factor b/extra/unix/stat/openbsd/64/64.factor index e4357ba70b..752574a43a 100644 --- a/extra/unix/stat/openbsd/64/64.factor +++ b/extra/unix/stat/openbsd/64/64.factor @@ -25,5 +25,5 @@ C-STRUCT: stat { "int64_t" "st_qspare1" } { "int64_t" "st_qspare2" } ; -! FUNCTION: int stat ( char* pathname, stat* buf ) ; +FUNCTION: int stat ( char* pathname, stat* buf ) ; FUNCTION: int lstat ( char* pathname, stat* buf ) ; diff --git a/extra/unix/stat/stat.factor b/extra/unix/stat/stat.factor index e0a6a9fb76..f7432332b9 100644 --- a/extra/unix/stat/stat.factor +++ b/extra/unix/stat/stat.factor @@ -63,7 +63,8 @@ FUNCTION: int mkdir ( char* path, mode_t mode ) ; { "linux" [ "unix.stat.linux" require ] } { "macosx" [ "unix.stat.macosx" require ] } { "freebsd" [ "unix.stat.freebsd" require ] } - [ drop ] + { "netbsd" [ "unix.stat.netbsd" require ] } + { "openbsd" [ "unix.stat.openbsd" require ] } } case >> diff --git a/extra/unix/types/types.factor b/extra/unix/types/types.factor index 59d0c05a87..ed2dbd5ba8 100644 --- a/extra/unix/types/types.factor +++ b/extra/unix/types/types.factor @@ -12,6 +12,5 @@ os { "freebsd" [ "unix.types.freebsd" require ] } { "openbsd" [ "unix.types.openbsd" require ] } { "netbsd" [ "unix.types.netbsd" require ] } - [ drop ] } case From c996c092fc4c03067a0695f1eee1a59798094746 Mon Sep 17 00:00:00 2001 From: Doug Coleman <doug.coleman@gmail.com> Date: Thu, 20 Mar 2008 15:24:30 -0500 Subject: [PATCH 2/4] start a unit test file for stat --- extra/unix/stat/stat-tests.factor | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 extra/unix/stat/stat-tests.factor diff --git a/extra/unix/stat/stat-tests.factor b/extra/unix/stat/stat-tests.factor new file mode 100644 index 0000000000..02ae29ae5a --- /dev/null +++ b/extra/unix/stat/stat-tests.factor @@ -0,0 +1,8 @@ +USING: kernel tools.test files.unique ; +IN: unix.stat.tests + +[ 123 ] [ + 123 CHAR: a <repetition> [ + write + ] with-unique-file file-size>> +] unit-test From 2f93c77e7c20a35d45a37549d0672036f775993c Mon Sep 17 00:00:00 2001 From: Doug Coleman <doug.coleman@gmail.com> Date: Thu, 20 Mar 2008 15:35:35 -0500 Subject: [PATCH 3/4] add -lz --- vm/Config.openbsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/Config.openbsd b/vm/Config.openbsd index 8724ebf378..240adf8087 100644 --- a/vm/Config.openbsd +++ b/vm/Config.openbsd @@ -2,4 +2,4 @@ include vm/Config.unix PLAF_DLL_OBJS += vm/os-genunix.o vm/os-openbsd.o CC = egcc CFLAGS += -export-dynamic -LIBS = -L/usr/local/lib/ -lm $(X11_UI_LIBS) +LIBS = -L/usr/local/lib/ -lm $(X11_UI_LIBS) -lz From bf57d5d5aaf496aa88372f4c66ad0df78916a3ac Mon Sep 17 00:00:00 2001 From: Doug Coleman <doug.coleman@gmail.com> Date: Thu, 20 Mar 2008 15:35:59 -0500 Subject: [PATCH 4/4] add openbsd to target --- misc/target | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/target b/misc/target index 880de8f47a..0be7781301 100755 --- a/misc/target +++ b/misc/target @@ -3,6 +3,9 @@ if [ \( `uname -s ` = FreeBSD \) -a \( `uname -p` = i386 \) ] then echo freebsd-x86-32 +elif [ \( `uname -s` = OpenBSD \) -a \( `uname -m` = i386 \) ] +then + echo openbsd-x86-32 elif [ \( `uname -s` = Darwin \) -a \( `uname -p` = powerpc \) ] then echo macosx-ppc