source: project/wiki/man/5/TODO/Unit posix @ 35112

Last change on this file since 35112 was 35112, checked in by sjamaan, 9 months ago

man/5: Move sleep and process-sleep from TODO to their new locations

File size: 3.9 KB
Line 
1[[tags: manual]]
2[[toc:]]
3
4== Unit posix
5
6This unit provides services as used on many UNIX-like systems.  Note that
7the following definitions are not all available on non-UNIX systems like
8Windows. See below for Windows specific notes.
9
10This unit uses the {{irregex}}, {{scheduler}}, and {{extras}} units.
11
12All errors related to failing file-operations will signal a condition
13of kind {{(exn i/o file)}}.
14
15
16=== Terminal ports
17
18==== terminal-name
19
20<procedure>(terminal-name PORT)</procedure>
21
22Returns the name of the terminal that is connected to {{PORT}}.
23
24==== terminal-port?
25
26<procedure>(terminal-port? PORT)</procedure>
27
28Returns {{#t}} if {{PORT}} is connected to a terminal and
29{{#f}} otherwise.
30
31
32==== terminal-size
33
34<procedure>(terminal-size PORT)</procedure>
35
36Returns two values, the number of columns and rows of the terminal
37that is connected to {{PORT}} or {{0}}, {{0}} if the terminal size can
38not be obtained. On Windows, this procedure always returns {{0}},
39{{0}}.
40
41
42=== How Scheme procedures relate to UNIX C functions
43
44; {{change-directory}} : {{chdir}}
45; {{change-directory*}} : {{fchdir}}
46; {{change-file-mode}} : {{chmod}}
47; {{change-file-owner}} : {{chown}}
48; {{create-directory}} : {{mkdir}}
49; {{create-fifo}} : {{mkfifo}}
50; {{create-pipe}} : {{pipe}}
51; {{create-session}} : {{setsid}}
52; {{create-symbolic-link}} : {{link}}
53; {{current-directory}} : {{curdir}}
54; {{current-effective-group-id}} : {{getegid}}
55; {{current-effective-user-id}} : {{geteuid}}
56; {{current-group-id}} : {{getgid}}
57; {{current-parent-id}} : {{getppid}}
58; {{current-process-id}} : {{getpid}}
59; {{current-user-id}} : {{getuid}}
60; {{delete-directory}} : {{rmdir}}
61; {{duplicate-fileno}} : {{dup/dup2}}
62; {{emergency-exit}} : {{_exit}}
63; {{file-close}} : {{close}}
64; {{file-access-time}} : {{stat}}
65; {{file-change-time}} : {{stat}}
66; {{file-creation-mode}} : {{umask}}
67; {{file-modification-time}} : {{stat}}
68; {{file-execute-access?}} : {{access}}
69; {{file-open}} : {{open}}
70; {{file-lock}} : {{fcntl}}
71; {{file-position}} : {{ftell/lseek}}
72; {{file-read}} : {{read}}
73; {{file-read-access?}} : {{access}}
74; {{file-select}} : {{select}}
75; {{file-control}} : {{fcntl}}
76; {{file-stat}} : {{stat}}
77; {{file-test-lock}} : {{fcntl}}
78; {{file-truncate}} : {{truncate/ftruncate}}
79; {{file-unlock}} : {{fcntl}}
80; {{file-write}} : {{write}}
81; {{file-write-access?}} : {{access}}
82; {{get-host-name}} : {{gethostname}}
83; {{local-time->seconds}} : {{mktime}}
84; {{local-timezone-abbreviation}} : {{localtime}}
85; {{open-input-file*}} : {{fdopen}}
86; {{open-output-file*}} : {{fdopen}}
87; {{open-input-pipe}} : {{popen}}
88; {{open-output-pipe}} : {{popen}}
89; {{port->fileno}} : {{fileno}}
90; {{process-execute}} : {{execvp}}
91; {{process-fork}} : {{fork}}
92; {{process-group-id}} : {{getpgid}}
93; {{process-signal}} : {{kill}}
94; {{process-sleep}} : {{sleep}}
95; {{process-wait}} : {{waitpid}}
96; {{close-input-pipe}} : {{pclose}}
97; {{close-output-pipe}} : {{pclose}}
98; {{read-symbolic-link}} : {{readlink}}
99; {{seconds->local-time}} : {{localtime}}
100; {{seconds->string}} : {{ctime}}
101; {{seconds->utc-time}} : {{gmtime}}
102; {{set-alarm!}} : {{alarm}}
103; {{set-buffering-mode!}} : {{setvbuf}}
104; {{set-file-position!}} : {{fseek/seek}}
105; {{set-signal-mask!}} : {{sigprocmask}}
106; {{set-group-id!}} : {{setgid}}
107; {{set-user-id!}} : {{setuid}}
108; {{set-root-directory!}} : {{chroot}}
109; {{set-environment-variable!}} : {{setenv/putenv}}
110; {{system-information}} : {{uname}}
111; {{terminal-name}} : {{ttyname}}
112; {{terminal-port?}} : {{isatty}}
113; {{time->string}} : {{asctime}}
114; {{unset-environment-variable!}} : {{unsetenv/putenv}}
115; {{user-information}} : {{getpwnam/getpwuid}}
116; {{utc-time->seconds}} : {{timegm}}
117
118
119=== Windows specific notes
120
121==== Unsupported Definitions
122
123The following definitions are not supported for native Windows builds (compiled with the
124Microsoft tools or with MinGW):
125
126 change-directory*
127 terminal-port?  terminal-name
128
129----
130Previous: [[Unit srfi-4]]
131
132Next: [[Unit tcp]]
Note: See TracBrowser for help on using the repository browser.