summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'hurd')
-rw-r--r--hurd/porting/guidelines.mdwn37
-rw-r--r--hurd/running/qemu.mdwn5
2 files changed, 42 insertions, 0 deletions
diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn
index bcfc8dd5..8dd27a52 100644
--- a/hurd/porting/guidelines.mdwn
+++ b/hurd/porting/guidelines.mdwn
@@ -232,3 +232,40 @@ Not implemented, not POSIX. Try to disable the feature in the package.
## <a name="parport"> <linux/parport.h> <linux/ppdev.h> </a>
There is no programming interface for the parallel port on GNU/Hurd yet.
+
+## <a name="errno"> `errno` values </a>
+
+When dealing with `errno`, you should always use the predefined error codes defined with the `E*` constants, instead of manually comparing/assigning/etc with their values.
+
+For example (C/C++):
+
+ /* check whether it does not exist */
+ if (errno == 2)
+ ...
+
+or Python:
+
+ # check whether it does not exist
+ try:
+ ...
+ except OSError, err:
+ err.errno == 2:
+ ...
+
+This is wrong, as [the actual values of the `E*` are unspecified (per POSIX)](http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html#tag_02_03). You must always use the predefined constants for the possible errors.
+
+For example (C/C++):
+
+ /* check whether it does not exist */
+ if (errno == ENOENT)
+ ...
+
+With Python, you can use the [`errno` module](http://docs.python.org/library/errno.html) for the various constants:
+
+ # check whether it does not exist
+ try:
+ ...
+ except OSError, err:
+ import errno
+ err.errno == errno.ENOENT:
+ ...
diff --git a/hurd/running/qemu.mdwn b/hurd/running/qemu.mdwn
index b3346af1..6b9062e9 100644
--- a/hurd/running/qemu.mdwn
+++ b/hurd/running/qemu.mdwn
@@ -108,6 +108,11 @@ If you just want to access the internet from within QEMU, you can setup pfinet f
(See also <http://www.nongnu.org/qemu/qemu-doc.html#SEC32>.)
Outgoing internet connections should just work then.
+Testing it can be difficult with a minimal installation,
+but `apt-get update` should work after you have filled out
+`/etc/apt/sources.list`.
+After that you should be able to install other network packages,
+but note that `ping` doesn't work with QEMU's user-networking stack.
If you want to connect from the host system to the Hurd system running in QEMU, you need to setup something more advanced, like bridged networking.