From cfccdc1bdbee7fb25ef0aa9639a3ffec926bf690 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 13 Dec 2010 19:56:25 +0100 Subject: Shuffle / create / enhance some UNIX / glibc pages. --- glibc.mdwn | 8 ++++++-- glibc/environment_variable.mdwn | 15 +++++++++++++++ glibc/environment_variables.mdwn | 15 --------------- glibc/file_descriptor.mdwn | 13 +++++++++++++ glibc/process.mdwn | 26 ++++++++++++++++++++++++++ glibc/signal.mdwn | 31 +++++++++++++++++++++++++++++++ glibc/signals.mdwn | 32 -------------------------------- hurd/glibc.mdwn | 8 +++----- hurd/glibc/internals.mdwn | 35 ----------------------------------- hurd/io_path.mdwn | 4 ++++ naming_context.mdwn | 17 ++++++++++++----- unix.mdwn | 13 ++++++++++++- unix/file_descriptor.mdwn | 4 ++++ unix/process.mdwn | 20 ++++++++++++++++++++ unix/signal.mdwn | 34 ++++++++++++++++++++++++++++++++++ 15 files changed, 180 insertions(+), 95 deletions(-) create mode 100644 glibc/environment_variable.mdwn delete mode 100644 glibc/environment_variables.mdwn create mode 100644 glibc/file_descriptor.mdwn create mode 100644 glibc/process.mdwn create mode 100644 glibc/signal.mdwn delete mode 100644 glibc/signals.mdwn delete mode 100644 hurd/glibc/internals.mdwn create mode 100644 unix/process.mdwn create mode 100644 unix/signal.mdwn diff --git a/glibc.mdwn b/glibc.mdwn index 124216d9..c47f3f1f 100644 --- a/glibc.mdwn +++ b/glibc.mdwn @@ -38,9 +38,13 @@ Porting glibc to a specific architecture is non-trivial. ## Concepts - * [[environment_variables]] + * [[environment_variable]] - * [[signals]] + * [[file_descriptor]] + + * [[process]] + + * [[signal]] ## Individual functions diff --git a/glibc/environment_variable.mdwn b/glibc/environment_variable.mdwn new file mode 100644 index 00000000..76c1371e --- /dev/null +++ b/glibc/environment_variable.mdwn @@ -0,0 +1,15 @@ +[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + + +# External + + * [*putenv() and setenv()*](http://www.greenend.org.uk/rjk/2008/putenv.html) + by Richard Kettlewell. diff --git a/glibc/environment_variables.mdwn b/glibc/environment_variables.mdwn deleted file mode 100644 index 76c1371e..00000000 --- a/glibc/environment_variables.mdwn +++ /dev/null @@ -1,15 +0,0 @@ -[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] - -[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable -id="license" text="Permission is granted to copy, distribute and/or modify this -document under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no Invariant -Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license -is included in the section entitled [[GNU Free Documentation -License|/fdl]]."]]"""]] - - -# External - - * [*putenv() and setenv()*](http://www.greenend.org.uk/rjk/2008/putenv.html) - by Richard Kettlewell. diff --git a/glibc/file_descriptor.mdwn b/glibc/file_descriptor.mdwn new file mode 100644 index 00000000..2c56d070 --- /dev/null +++ b/glibc/file_descriptor.mdwn @@ -0,0 +1,13 @@ +[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +A [[UNIX file descriptor|unix/file_descriptor]] is implemented in [[glibc]] by +using operations on objects referred to by [[Mach +ports|microkernel/mach/port]]). diff --git a/glibc/process.mdwn b/glibc/process.mdwn new file mode 100644 index 00000000..9b2ec251 --- /dev/null +++ b/glibc/process.mdwn @@ -0,0 +1,26 @@ +[[!meta copyright="Copyright © 2009, 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +The GNU Hurd uses a similar concept to [[UNIX processes|unix/process]]. + +As a [[Mach task|microkernel/mach/task]] only implements a part of a UNIX +process, there is additional work to be done, for example for [[signal]]s, +[[environment_variable]]s, [[file_descriptor]]s. + + +# Controlling TTY + +Hurd controlling tty behavior is generally consistent with BSD's, including +`TIOCSCTTY`. Linux also has `TIOCSCTTY` and it is harmless to use it there. +But BSD and Hurd never do an implicit `TIOCSCTTY` (hence our `O_NOCTTY` is +zero). + +C.f. and the +following messages. diff --git a/glibc/signal.mdwn b/glibc/signal.mdwn new file mode 100644 index 00000000..67028fef --- /dev/null +++ b/glibc/signal.mdwn @@ -0,0 +1,31 @@ +[[!meta copyright="Copyright © 2009, 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +The [[*UNIX signalling mechanism*|unix/signal]] is implemented for the GNU Hurd +by means of a separate *signal-handling [[thread]]* that is part of every +[[process]]. This makes handling of signals a separate thread of control. + + * [[SA_SIGINFO, SA_SIGACTION|open_issues/sa_siginfo_sa_sigaction]] + + * Why does `kill` hang sometimes? + + kill send the signal to the process + if the process is hung, killing waits + signals should be just asynchronous, but apparently for some + reason Roland & co wanted some synchronization + + [[!taglink open_issue_glibc]] + + +# Further Reading + + * {{$unix#djb_self-pipe}}. + + * {{$unix#rjk_fork}}. diff --git a/glibc/signals.mdwn b/glibc/signals.mdwn deleted file mode 100644 index 40fdc0e1..00000000 --- a/glibc/signals.mdwn +++ /dev/null @@ -1,32 +0,0 @@ -[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] - -[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable -id="license" text="Permission is granted to copy, distribute and/or modify this -document under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no Invariant -Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license -is included in the section entitled [[GNU Free Documentation -License|/fdl]]."]]"""]] - -*[[UNIX]] signals* are a means to asynchronously invoke a specific function -(*signal handler*). This may impact on [[system call]]s that are executing at -the same time in that they may be completely aborted, return incomplete -results, scheduled for restarting, or cause signal delivery to be blocked upon -the system call's completion. - -An explanation can be found in the relevant standards, an overview, including -UNIX signals' deficiencies is given in {{$unix#2010_brown_ghosts_3}}, for -example. - -The UNIX signalling mechanism is implemented for the GNU Hurd by means of a -separate signal-handling thread that is part of every process. This makes -handling of signals a separate thread of control. - - * [[SA_SIGINFO, SA_SIGACTION|open_issues/sa_siginfo_sa_sigaction]] - - -# External - - * {{$unix#djb_self-pipe}}. - - * {{$unix#rjk_fork}}. diff --git a/hurd/glibc.mdwn b/hurd/glibc.mdwn index bdfed833..39bfed62 100644 --- a/hurd/glibc.mdwn +++ b/hurd/glibc.mdwn @@ -1,4 +1,4 @@ -[[!meta copyright="Copyright © 2007, 2008, 2009 Free Software Foundation, +[[!meta copyright="Copyright © 2007, 2008, 2009, 2010 Free Software Foundation, Inc."]] [[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable @@ -6,8 +6,8 @@ id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license -is included in the section entitled -[[GNU Free Documentation License|/fdl]]."]]"""]] +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] [[General_information|/glibc]] about the glibc. @@ -17,5 +17,3 @@ For information about how the glibc integrates into the system, see sections [[Hurd-specific_API]]. [[Debugging_glibc|debugging/glibc]]. - -[[Internals]]. diff --git a/hurd/glibc/internals.mdwn b/hurd/glibc/internals.mdwn deleted file mode 100644 index 897da92e..00000000 --- a/hurd/glibc/internals.mdwn +++ /dev/null @@ -1,35 +0,0 @@ -[[!meta copyright="Copyright © 2009 Free Software Foundation, Inc."]] - -[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable -id="license" text="Permission is granted to copy, distribute and/or modify this -document under the terms of the GNU Free Documentation License, Version 1.2 or -any later version published by the Free Software Foundation; with no Invariant -Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license -is included in the section entitled [[GNU Free Documentation -License|/fdl]]."]]"""]] - -Some bits about this, some bits about that. - -# Controlling TTY - -Hurd controlling tty behavior is generally consistent with BSD's, including -`TIOCSCTTY`. Linux also has `TIOCSCTTY` and it is harmless to use it there. -But BSD and Hurd never do an implicit `TIOCSCTTY` (hence our `O_NOCTTY` is -zero). - -C.f. and the -following messages. - -# Sinals - -[[Unix]] signals are implemented in glibc. - -In every process, signals are handled in a separate signal thread. - - [Why does kill hang sometimes?] - kill send the signal to the process - if the process is hung, killing waits - signals should be just asynchronous, but apparently for some reason - Roland & co wanted some syunchronization - -[[!taglink open_issue_glibc]] diff --git a/hurd/io_path.mdwn b/hurd/io_path.mdwn index 598ad967..0d83a4ba 100644 --- a/hurd/io_path.mdwn +++ b/hurd/io_path.mdwn @@ -50,3 +50,7 @@ License|/fdl]]."]]"""]] nice overview of the related layering inside the Linux kernel, including the VFS layer, page cache and directory entry cache (dcache). + + +[[!tag open_issue_documentation]] diff --git a/naming_context.mdwn b/naming_context.mdwn index 3a0751c0..2968b0a5 100644 --- a/naming_context.mdwn +++ b/naming_context.mdwn @@ -1,18 +1,22 @@ -[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]] +[[!meta copyright="Copyright © 2007, 2008, 2010 Free Software Foundation, +Inc."]] [[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license -is included in the section entitled -[[GNU Free Documentation License|/fdl]]."]]"""]] +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] Names are bindings to objects, however, to find an object given a name, the relation must be looked up in a -naming context. A problem with using string as names is +*naming context*. + +A problem with using strings as names is that it is very easy to lose track of the correct naming -context. This is one of the problem with [[PassiveTranslators]]: +context. This is one of the problem with [[passive +translators|hurd/translator]]: a passive translator is a string. When the node is accessed on which the passive translator is set and there is no active translator, then an active translator is started using the @@ -22,3 +26,6 @@ passive translator. The passive translator settings are therefore resolved in the file system's naming context, which may be different from that of the program instance that set the passive translator setting. + +[[!tag open_issue_hurd open_issue_documentation]] diff --git a/unix.mdwn b/unix.mdwn index 3cfe7771..8694f7b0 100644 --- a/unix.mdwn +++ b/unix.mdwn @@ -13,6 +13,17 @@ License|/fdl]]."]]"""]] *UNIX* is a [[kernel]] implementation. +# Concepts + + * [[file_descriptor]] + + * [[process]] + + * [[signal]] + + * [[system_call]] + + # External * Wikipedia page about [[!wikipedia UNIX]]. @@ -31,7 +42,7 @@ License|/fdl]]."]]"""]] to the `open` [[system_call]]. In {{$2010_brown_ghosts_3}}, he deals with *unfixable designs*, such as - [[UNIX signals|glibc/signals]] and the *UNIX permission model* (which is + UNIX [[signal]]s and the *UNIX permission model* (which is clearly inferior to a [[capability]]-based system). * [*UNIX File Permissions*](http://www.greenend.org.uk/rjk/2004/perms.html) diff --git a/unix/file_descriptor.mdwn b/unix/file_descriptor.mdwn index 16e03fdf..6f8533c5 100644 --- a/unix/file_descriptor.mdwn +++ b/unix/file_descriptor.mdwn @@ -11,3 +11,7 @@ License|/fdl]]."]]"""]] A *file descriptor* is a [[concept]] of [[UNIX]], and represents a non-[[persistent|persistency]] handle to an object (a file, for example). With respect to specific aspects, it is comparable to a [[capability]]. + +In a GNU Hurd system, the concept of file descriptors is based on object +handles (through [[Mach ports|microkernel/mach/port]]), and is [[implemented in +glibc|glibc/file_descriptor]]. diff --git a/unix/process.mdwn b/unix/process.mdwn new file mode 100644 index 00000000..21fbfc69 --- /dev/null +++ b/unix/process.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +A *UNIX process* is TODO. + +Generally, especially in [[microkernel]]-based systems, the [[kernel]]'s idea +of a task is not as encompassing as a UNIX process, and will use additional +effort to enhance the kernel's primitive to a full-fledged UNIX model. + +A [[Mach task|microkernel/mach/task]] implements a part of a UNIX process. + +In the GNU/Hurd, processes are based on [[Mach task|microkernel/mach/task]]s, +but are [[enhanced by the glibc|glibc/process]]. diff --git a/unix/signal.mdwn b/unix/signal.mdwn new file mode 100644 index 00000000..0d038a45 --- /dev/null +++ b/unix/signal.mdwn @@ -0,0 +1,34 @@ +[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +*[[UNIX]] signals* are a means to asynchronously invoke a specific function +(*signal handler*) in a [[process]]. It's a rather limited for of doing +[[IPC]]. + +Signalling may impact on [[system call]]s that are executing at the same time +in that they may be completely aborted, return incomplete results, scheduled +for restarting, or cause signal delivery to be blocked upon the system call's +completion. + +An explanation can be found in the relevant standards, an overview, including +UNIX signals' deficiencies is given in {{$unix#2010_brown_ghosts_3}}, for +example. + +In a GNU/Hurd system, the signalling system is [[implemented in +glibc|glibc/signal]]. + + +# Further Reading + + * [[!wikipedia Signal_(computing)]] + + * {{$unix#djb_self-pipe}}. + + * {{$unix#rjk_fork}}. -- cgit v1.2.3