diff --git a/basis/unix/ffi/linux/linux.factor b/basis/unix/ffi/linux/linux.factor index a28935feef..8d7bec607a 100644 --- a/basis/unix/ffi/linux/linux.factor +++ b/basis/unix/ffi/linux/linux.factor @@ -277,3 +277,25 @@ CONSTANT: SIGPWR 30 CONSTANT: SIGSYS 31 FUNCTION: ssize_t sendfile ( int out_fd, int in_fd, off_t* offset, size_t count ) ; + + +CONSTANT: __UT_LINESIZE 32 +CONSTANT: __UT_NAMESIZE 32 +CONSTANT: __UT_HOSTSIZE 256 + +STRUCT: exit_status + { e_termination short } + { e_exit short } ; + +STRUCT: utmpx + { ut_type short } + { ut_pid pid_t } + { ut_line short } + { ut_id short } + { ut_user short } + { ut_host short } + { ut_exit exit_status } + { ut_session long } + { ut_tv timeval } + { ut_addr_v6 int[4] } + { __unused char[20] } ; diff --git a/basis/unix/utmpx/macosx/authors.txt b/basis/unix/utmpx/macosx/authors.txt deleted file mode 100644 index b4bd0e7b35..0000000000 --- a/basis/unix/utmpx/macosx/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Doug Coleman \ No newline at end of file diff --git a/basis/unix/utmpx/macosx/macosx-tests.factor b/basis/unix/utmpx/macosx/macosx-tests.factor deleted file mode 100644 index b0aa97dbca..0000000000 --- a/basis/unix/utmpx/macosx/macosx-tests.factor +++ /dev/null @@ -1,4 +0,0 @@ -! Copyright (C) 2008 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: tools.test unix.utmpx.macosx ; -IN: unix.utmpx.macosx.tests diff --git a/basis/unix/utmpx/macosx/macosx.factor b/basis/unix/utmpx/macosx/macosx.factor deleted file mode 100644 index b33c448a26..0000000000 --- a/basis/unix/utmpx/macosx/macosx.factor +++ /dev/null @@ -1,6 +0,0 @@ -! Copyright (C) 2008 Doug Coleman. -! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax unix.ffi.macosx ; -IN: unix.utmpx.macosx - -! empty diff --git a/basis/unix/utmpx/macosx/platforms.txt b/basis/unix/utmpx/macosx/platforms.txt deleted file mode 100644 index 6e806f449e..0000000000 --- a/basis/unix/utmpx/macosx/platforms.txt +++ /dev/null @@ -1 +0,0 @@ -macosx diff --git a/basis/unix/utmpx/platforms.txt b/basis/unix/utmpx/platforms.txt index 6e806f449e..509143d863 100644 --- a/basis/unix/utmpx/platforms.txt +++ b/basis/unix/utmpx/platforms.txt @@ -1 +1 @@ -macosx +unix diff --git a/basis/unix/utmpx/utmpx-tests.factor b/basis/unix/utmpx/utmpx-tests.factor new file mode 100644 index 0000000000..d7f6c02921 --- /dev/null +++ b/basis/unix/utmpx/utmpx-tests.factor @@ -0,0 +1,6 @@ +! Copyright (C) 2013 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: kernel tools.test unix.utmpx ; +IN: unix.utmpx.tests + +{ } [ all-utmpx drop ] unit-test diff --git a/basis/unix/utmpx/utmpx.factor b/basis/unix/utmpx/utmpx.factor index 64a38a3c7c..ef3731de2a 100644 --- a/basis/unix/utmpx/utmpx.factor +++ b/basis/unix/utmpx/utmpx.factor @@ -19,8 +19,6 @@ CONSTANT: ACCOUNTING 9 CONSTANT: SIGNATURE 10 CONSTANT: SHUTDOWN_TIME 11 -C-TYPE: utmpx - FUNCTION: void setutxent ( ) ; FUNCTION: void endutxent ( ) ; FUNCTION: utmpx* getutxent ( ) ; @@ -41,8 +39,7 @@ M: unix new-utmpx-record utmpx-record new ; M: unix utmpx>utmpx-record ( utmpx -- utmpx-record ) - [ new-utmpx-record ] dip - { + [ new-utmpx-record ] dip { [ ut_user>> _UTX_USERSIZE memory>string >>user ] [ ut_id>> _UTX_IDSIZE memory>string >>id ] [ ut_line>> _UTX_LINESIZE memory>string >>line ] @@ -61,7 +58,3 @@ M: unix utmpx>utmpx-record ( utmpx -- utmpx-record ) [ utmpx>utmpx-record ] produce nip ] with-utmpx ; - -os { - { macosx [ "unix.utmpx.macosx" require ] } -} case