summaryrefslogtreecommitdiff
path: root/glibc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@schwinge.name>2010-12-13 17:11:51 +0100
committerThomas Schwinge <thomas@schwinge.name>2010-12-13 17:11:51 +0100
commit2d75167da62e3486836e5f1773e5f1ab06e43fe8 (patch)
treee44fc83e0b1419836d1b21652ad1d38b8d0af2c4 /glibc
parent217998d56f5b6424a685f8c87f2c0e924d1c89da (diff)
parent5c5c16e265d8ef56b71f319885f32bf144bdea23 (diff)
Merge branch 'master' into external_pager_mechanism
Conflicts: microkernel/mach/external_pager_mechanism.mdwn
Diffstat (limited to 'glibc')
-rw-r--r--glibc/environment_variables.mdwn15
-rw-r--r--glibc/fallocate.mdwn17
-rw-r--r--glibc/fork.mdwn64
-rw-r--r--glibc/poll.mdwn15
-rw-r--r--glibc/signals.mdwn32
5 files changed, 143 insertions, 0 deletions
diff --git a/glibc/environment_variables.mdwn b/glibc/environment_variables.mdwn
new file mode 100644
index 00000000..76c1371e
--- /dev/null
+++ b/glibc/environment_variables.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/fallocate.mdwn b/glibc/fallocate.mdwn
new file mode 100644
index 00000000..3aecf16b
--- /dev/null
+++ b/glibc/fallocate.mdwn
@@ -0,0 +1,17 @@
+[[!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]]."]]"""]]
+
+Not yet implemented for the GNU Hurd in [[glibc]].
+
+
+# External
+
+ * [*Punching holes in files*](http://lwn.net/Articles/415889/), Jonathan
+ Corbet, 2010-11-17.
diff --git a/glibc/fork.mdwn b/glibc/fork.mdwn
new file mode 100644
index 00000000..378fe835
--- /dev/null
+++ b/glibc/fork.mdwn
@@ -0,0 +1,64 @@
+[[!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]]."]]"""]]
+
+On [[Unix]] systems, `fork` is a rather simple [[system call]].
+
+Our implementation in [[glibc]] is and needs to be rather bulky.
+
+For example, it has to duplicate all port rights for the new [[Mach
+task|microkernel/mach/task]]. The address space can simply be duplicated by
+standard means of the [[microkernel/Mach]], but as [[unix/file_descriptor]]s
+(for example) are a concept that is implemented inside [[glibc]] (based on
+[[Mach port|microkernel/mach/port]]s), these have to be duplicated from
+userspace, which requires a small number of [[RPC]] for each of them.
+
+In sum, [[this affects performance|open_issues/performance/fork]] when new
+processes are continuously being spawned from the shell, for example.
+
+Often, a `fork` call will eventually be followed by an `exec`, which [[may in
+turn close|open_issues/secure_file_descriptor_handling]] (most of) the
+duplicated port rights. Unfortunately, this cannot be known at the time the
+`fork` executing, so in order to optimize this, the code calling `fork` has to
+be modified instead, and the `fork`, `exec` combo be replaced by a
+`posix_spawn` call, for example, to avoid this work of duplicating each port
+right, then closing each again.
+
+As far as we know, Cygwin has the same problem of `fork` being a nontrivial
+operation. Perhaps we can learn from what they're been doing? Also, perhaps
+they have patches for software packages, to avoid using `fork` followed by
+`exec`, for example.
+
+
+# TODO
+
+ * [[fork: mach_port_mod_refs:
+ EKERN_UREFS_OWERFLOW|open_issues/fork_mach_port_mod_refs_ekern_urefs_owerflow]]
+ ([[!taglink open_issue_glibc]]).
+
+ * Include de-duplicate information from elsewhere: [[hurd-paper]],
+ [[hurd-talk]], [[hurd/ng/trivialconfinementvsconstructorvsfork]],
+ [[open_issues/resource_management_problems/zalloc_panics]] ([[!taglink
+ open_issue_glibc open_issue_documentation]]).
+
+ * We no longer support `MACH_IPC_COMPAT`, thus we can get rid of the `err =
+ __mach_port_allocate_name ([...]); if (err == KERN_NAME_EXISTS)` code
+ ([[!taglink open_issue_glibc]]).
+
+
+## Related
+
+ * [[open_issues/secure_file_descriptor_handling]].
+
+
+# External
+
+ * {{$unix#djb_self-pipe}}.
+
+ * {{$unix#rjk_fork}}.
diff --git a/glibc/poll.mdwn b/glibc/poll.mdwn
new file mode 100644
index 00000000..d96f27a5
--- /dev/null
+++ b/glibc/poll.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
+
+ * [*poll() and EOF*](http://www.greenend.org.uk/rjk/2001/06/poll.html) by
+ Richard Kettlewell.
diff --git a/glibc/signals.mdwn b/glibc/signals.mdwn
new file mode 100644
index 00000000..40fdc0e1
--- /dev/null
+++ b/glibc/signals.mdwn
@@ -0,0 +1,32 @@
+[[!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}}.