Changeset 13078 in project


Ignore:
Timestamp:
01/24/09 18:34:02 (11 years ago)
Author:
Kon Lovett
Message:

Alaric Snell-Pym svnwiki additions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/posix-extensions/trunk/posix-extensions.wiki

    r13031 r13078  
    1111== Documentation
    1212
    13                                 (subsubsection "File Descriptors"
     13=== File Descriptors
    1414
    15           (procedure "(replace-fileno NEW-FILENO KNOWN-FILENO)"
    16             (p "Replaces the meaning of " (tt "KNOWN-FILENO") " with "
    17             (tt "NEW-FILENO") ". I/O Redirection.") )
    18         )
     15<procedure>(replace-fileno NEW-FILENO KNOWN-FILENO)</procedure>
    1916
    20                                 (subsubsection "Scheduling Priority"
     17Replaces the meaning of {{KNOWN-FILENO}} with {{NEW-FILENO}}.
    2118
    22           (p "Parameter Descriptions")
    23           (symbol-table
    24             (describe priority/process
    25               "Process WHICH - WHO is 0 for current process or a process identifier.")
    26             (describe priority/process-group
    27               "Process Group WHICH - WHO is 0 for current process group or a process group identifier.")
    28             (describe priority/user
    29               "User WHICH - WHO is 0 for current user or a user identifier.")
    30             (describe PRIORITY
    31               "An integer [-20 20].") )
    32           (br)
     19=== Scheduling Priority
    3320
    34           (procedure "(scheduling-priority WHICH WHO)"
    35             (p "Returns the priority of " (tt "WHO") " of kind " (tt "WHICH") ".") )
     21Processes are identified by two values, {{WHICH}} and {{WHO}}. The value of
     22{{WHICH}} defines how {{WHO}} is interpreted. The {{WHICH}} values are:
    3623
    37           (procedure "(set-scheduling-priority! WHICH WHO PRIORITY)"
    38             (p "Sets the priority of " (tt "WHO") " of kind " (tt "WHICH") " to "
    39             (tt "PRIORITY") ".") )
    40         )
     24<constant>priority/process</constant>
    4125
    42                                 (subsubsection "Pseudo-TTY"
     26{{WHO}} is a process ID, or {{0}} to refer to the current process.
    4327
    44           (p "Currently a thin wrapper around the C interface. Scheme bindings "
    45           "for the necessary C constants are not provided.")
     28<constant>priority/process-group</constant>
    4629
    47           (procedure "(alloc-winsize)"
    48             (p "Returns the pointer to a new C struct winsize.") )
     30{{WHO}} is a process group ID, or {{0}} to refer to the current process group.
    4931
    50           (procedure "(free-winsize (nonnull-pointer WINSIZE))"
    51             (p "Releases a C struct winsize.") )
     32<constant>priority/user</constant>
    5233
    53           (p "Accessors for a struct winsize")
    54           (symbol-table
    55             (describe winsize-col "Returns ws_col")
    56             (describe winsize-col-set! "Sets ws_col")
    57             (describe winsize-row "Returns ws_row")
    58             (describe winsize-row-set! "Sets ws_row")
    59             (describe winsize-xpixel "Returns ws_xpixel")
    60             (describe winsize-xpixel-set! "Sets ws_xpixel")
    61             (describe winsize-ypixel "Returns ws_ypixel")
    62             (describe winsize-ypixel-set! "Sets ws_ypixel") )
    63           (br)
     34{{WHO}} is a user ID, or {{0}} to refer to the current user.
    6435
    65           (procedure "(alloc-termios)"
    66             (p "Returns the pointer to a new C struct termios.") )
     36<procedure>(scheduling-priority WHICH WHO)</procedure>
    6737
    68           (procedure "(free-termios (nonnull-pointer TERMIOS))"
    69             (p "Releases a C struct termios.") )
     38Returns the priority of {{WHO}} of kind {{WHICH}}.
    7039
    71           (p "Accessors for a struct termios")
    72           (symbol-table
    73             (describe termios-cc "Returns c_cc[idx]")
    74             (describe termios-cc-set! "Sets c_cc[idx]")
    75             (describe termios-cflag "Returns c_cflag")
    76             (describe termios-cflag-set! "Sets c_cflag")
    77             (describe termios-iflag "Returns c_iflag")
    78             (describe termios-iflag-set! "Sets c_iflag")
    79             (describe termios-lflag "Returns c_lflag")
    80             (describe termios-lflag-set! "Sets c_lflag")
    81             (describe termios-oflag "Returns c_oflag")
    82             (describe termios-oflag-set! "Sets c_oflag")
    83             (describe termios-ispeed "Returns c_ispeed")
    84             (describe termios-ispeed-set! "Sets c_ispeed")
    85             (describe termios-ospeed "Returns c_ospeed")
    86             (describe termios-ospeed-set! "Sets c_ospeed") )
    87           (br)
     40<procedure>(set-scheduling-priority! WHICH WHO PRIORITY)</procedure>
    8841
    89           (procedure "(login-tty SLAVE-FILENO)"
    90             (p "The C procedure.") )
     42Sets the priority of {{WHO}} of kind {{WHICH}} to {{PRIORITY}}, which must be
     43an integer between {{-20}} and {{20}} inclusive.
    9144
    92           (procedure "(open-pty (nonnull-pointer MASTER-FILENO) (nonnull-pointer SLAVE-FILENO) (c-string NAME) (pointer WINSIZE) (pointer TERMIOS))"
    93             (p "The C procedure.") )
    94         )
     45=== Pseudo-TTYs
     46
     47This is currently a thin wrapper around the C interface. Scheme bindings for
     48the necessary C constants are not yet provided.
     49
     50<procedure>(login-tty SLAVE-FILENO)</procedure>
     51
     52As per the C function {{login_tty}}, prepares the pty slave for use.
     53
     54<procedure>(open-pty MASTER-FILENO SLAVE-FILENO NAME WINSIZE TERMIOS)</procedure>
     55
     56As per the C function {{open_pty}}, creates a new pty, and assigns the master
     57and slave fds into {{MASTER-FILENO}} and {{SLAVE-FILENO}} (which should be
     58pointers to fds).
     59
     60==== Window size
     61
     62<procedure>(alloc-winsize) => WINSIZE</procedure>
     63
     64Returns the pointer to a new C {{struct winsize}}.
     65
     66<procedure>(free-winsize WINSIZE)</procedure>
     67
     68Releases a C struct winsize.
     69
     70Winsizes have the following accessors:
     71
     72<procedure>(winsize-col WINSIZE) => WS_COL</procedure>
     73<procedure>(winsize-col-set! WINSIZE WS_COL)</procedure>
     74
     75<procedure>(winsize-row WINSIZE) => WS_ROW</procedure>
     76<procedure>(winsize-row-set! WINSIZE WS_ROW)</procedure>
     77
     78<procedure>(winsize-xpixel WINSIZE) => WS_XPIXEL</procedure>
     79<procedure>(winsize-xpixel-set! WINSIZE WS_XPIXEL)</procedure>
     80
     81<procedure>(winsize-ypixel WINSIZE) => WS_YPIXEL</procedure>
     82<procedure>(winsize-ypixel-set! WINSIZE WS_YPIXEL)</procedure>
     83
     84==== Termios
     85
     86<procedure>(alloc-termios) => TERMIOS</procedure>
     87
     88Returns the pointer to a new C {{struct termios}}.
     89
     90<procedure>(free-termios TERMIOS)</procedure>
     91
     92Releases a C {{struct termios}}.
     93
     94Termioses have the following accessors:
     95
     96<procedure>(termios-cc TERMIOS IDX) => C_CC</procedure>
     97<procedure>(termios-cc-set! TERMIOS IDX C_CC)</procedure>
     98
     99<procedure>(termios-cflag TERMIOS) => C_CFLAG</procedure>
     100<procedure>(termios-cflag-set! TERMIOS C_CFLAG)</procedure>
     101
     102<procedure>(termios-iflag TERMIOS) => C_IFLAG</procedure>
     103<procedure>(termios-iflag-set! TERMIOS C_IFLAG)</procedure>
     104
     105<procedure>(termios-lflag TERMIOS) => C_LFLAG</procedure>
     106<procedure>(termios-lflag-set! TERMIOS C_LFLAG)</procedure>
     107
     108<procedure>(termios-oflag TERMIOS) => C_OFLAG</procedure>
     109<procedure>(termios-oflag-set! TERMIOS C_OFLAG)</procedure>
     110
     111<procedure>(termios-ispeed TERMIOS) => C_ISPEED</procedure>
     112<procedure>(termios-ispeed-set! TERMIOS C_ISPEED)</procedure>
     113
     114<procedure>(termios-ospeed TERMIOS) => C_OSPEED</procedure>
     115<procedure>(termios-ospeed-set! TERMIOS C_OSPEED)</procedure>
     116
     117==== Stat object types
     118
     119The posix unit declares constants for file modes, but the mode returned by
     120{{file-stat}} also includes higher-order bits for the type of object. See the
     121manpage for {{stat(2)}} for details.
     122
     123<constant>stat/ifmt</constant>
     124<constant>stat/ififo</constant>
     125<constant>stat/ifchr</constant>
     126<constant>stat/ifdir</constant>
     127<constant>stat/ifblk</constant>
     128<constant>stat/ifreg</constant>
     129<constant>stat/iflnk</constant>
     130<constant>stat/ifsock</constant>
     131
     132==== File metadata
     133
     134<procedure>(change-link-mode FILENAME MODE)</procedure>
     135
     136As per {{change-file-mode}} in [[Unix posix]], but if used on a symlink,
     137operates upon the link itself rather than on the object linked to.
     138
     139<procedure>(change-link-owner FILENAME UID GID)</procedure>
     140
     141As per {{change-file-owner}} in [[Unix posix]], but if used on a symlink,
     142operates upon the link itself rather than on the object linked to.
     143
     144<procedure>(create-special-file FILENAME MODE DEVICE-NUMBER)</procedure>
     145
     146Creates a special file using the {{mknod(2)}} system call.
     147
     148<procedure>(change-file-times FILENAME ATIME MTIME)</procedure>
     149
     150Sets the atime and mtime of a file using the {{utime(2)}} system call.
    95151
    96152
     
    107163
    108164[[kon lovett]]
    109 [[Alaric Snell-Pym]]
     165[[alaric-blagrave-snellpym|Alaric Snell-Pym]]
    110166
    111167
    112168== License
    113169
    114 Copyright (C) 2006-2008 Kon Lovett, Alaric Snell-Pym.  All rights reserved.
     170Copyright (C) 2006-2008 Kon Lovett.  All rights reserved.
    115171Copyright (C) 2009 Kon Lovett, Alaric Snell-Pym.  All rights reserved.
    116172
Note: See TracChangeset for help on using the changeset viewer.