posix.scm 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ;;; installed-scm-file
  2. ;;;; Copyright (C) 1999, 2006 Free Software Foundation, Inc.
  3. ;;;;
  4. ;;;; This library is free software; you can redistribute it and/or
  5. ;;;; modify it under the terms of the GNU Lesser General Public
  6. ;;;; License as published by the Free Software Foundation; either
  7. ;;;; version 2.1 of the License, or (at your option) any later version.
  8. ;;;;
  9. ;;;; This library is distributed in the hope that it will be useful,
  10. ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. ;;;; Lesser General Public License for more details.
  13. ;;;;
  14. ;;;; You should have received a copy of the GNU Lesser General Public
  15. ;;;; License along with this library; if not, write to the Free Software
  16. ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. ;;;;
  18. (define (stat:dev f) (vector-ref f 0))
  19. (define (stat:ino f) (vector-ref f 1))
  20. (define (stat:mode f) (vector-ref f 2))
  21. (define (stat:nlink f) (vector-ref f 3))
  22. (define (stat:uid f) (vector-ref f 4))
  23. (define (stat:gid f) (vector-ref f 5))
  24. (define (stat:rdev f) (vector-ref f 6))
  25. (define (stat:size f) (vector-ref f 7))
  26. (define (stat:atime f) (vector-ref f 8))
  27. (define (stat:mtime f) (vector-ref f 9))
  28. (define (stat:ctime f) (vector-ref f 10))
  29. (define (stat:blksize f) (vector-ref f 11))
  30. (define (stat:blocks f) (vector-ref f 12))
  31. ;; derived from stat mode.
  32. (define (stat:type f) (vector-ref f 13))
  33. (define (stat:perms f) (vector-ref f 14))
  34. (define (passwd:name obj) (vector-ref obj 0))
  35. (define (passwd:passwd obj) (vector-ref obj 1))
  36. (define (passwd:uid obj) (vector-ref obj 2))
  37. (define (passwd:gid obj) (vector-ref obj 3))
  38. (define (passwd:gecos obj) (vector-ref obj 4))
  39. (define (passwd:dir obj) (vector-ref obj 5))
  40. (define (passwd:shell obj) (vector-ref obj 6))
  41. (define (group:name obj) (vector-ref obj 0))
  42. (define (group:passwd obj) (vector-ref obj 1))
  43. (define (group:gid obj) (vector-ref obj 2))
  44. (define (group:mem obj) (vector-ref obj 3))
  45. (define (utsname:sysname obj) (vector-ref obj 0))
  46. (define (utsname:nodename obj) (vector-ref obj 1))
  47. (define (utsname:release obj) (vector-ref obj 2))
  48. (define (utsname:version obj) (vector-ref obj 3))
  49. (define (utsname:machine obj) (vector-ref obj 4))
  50. (define (getpwent) (getpw))
  51. (define (setpwent) (setpw #t))
  52. (define (endpwent) (setpw))
  53. (define (getpwnam name) (getpw name))
  54. (define (getpwuid uid) (getpw uid))
  55. (define (getgrent) (getgr))
  56. (define (setgrent) (setgr #t))
  57. (define (endgrent) (setgr))
  58. (define (getgrnam name) (getgr name))
  59. (define (getgrgid id) (getgr id))