summaryrefslogtreecommitdiff
path: root/open_issues/translate_fd_or_port_to_file_name.mdwn
blob: bd9abcf97cad77a8cec22dd746ab4b08eb4f3dfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
[[!meta copyright="Copyright © 2010, 2011 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]]."]]"""]]

[[!tag open_issue_glibc open_issue_hurd]]

[[!toc]]


# IRC, freenode, #hurd, June (?) 2010

    <pochu> is there a way (POSIX or Hurdish) to get the corresponding file name for a fd or a hurd port?
    <marcusb> there is a way
    <pochu> marcusb: which one would that be?
    <marcusb> I forgot
    <marcusb> there is an implementation in libc
    <marcusb> realpath has a similar job
    <marcusb> but that's not what I mean
    <marcusb> pochu: maybe I am misremembering.  But it was something where you keep looking up .. and list that directory, looking for the node with the ID of the node you had .. for
    <marcusb> maybe it works only for directories
    <marcusb> yeah
    <marcusb> pochu: check the getcwd() implementation of libc
    <marcusb> sysdeps/mach/hurd/getcwd.c
    <marcusb> _hurd_canonicalize_directory_name_internal 
    * pochu looks
    <pochu> marcusb: interesting
    <pochu> though that is for dirs, and doesn't seem to be extensible to files, as you cannot lookup for ".." under a file
    <marcusb> right
    <pochu> oh you already said that :)
    <marcusb> actually, I am not sure that's correct
    <marcusb> it's probably correct, but there is no reason why looking .. up on a file couldn't return the directory it's contianed in
    <pochu> I don't know the interfaces or the Hurd internals very well yet, but it would look strange to me if you could do that
    <marcusb> the hurd is strange
    <pochu> it sounds like if you could `ls getcwd.c/..` to get sysdeps/mach/hurd/ :-)
    <marcusb> yep
    <pochu> ok. interesting
    <marcusb> you wouldn't find "ls foo.zip/.." very strange, wouldn't you?
    <pochu> I guess not if `ls foo.zip` listed the contents of foo.zip
    <marcusb> there you go
    <marcusb> or the other way round: would you be surprised if "cat somedir" would work?
    <pochu> I think so. if it did, what would it do?
    <marcusb> originally, cat dir would list the directory content!
    <marcusb> in the old unix times
    <pochu> I was surprised the first time I typed `vi somedir` by accident
    <marcusb> and some early BSDs 
    * pochu feels young :-)
    <marcusb> he don't worry, I didn't see those times either
    <marcusb> technically, files and directories are implemented in the same way in the hurd, they both are objects implementing the fs.defs interface
    <marcusb> which combines file and directory operations
    <marcusb> of course, files and directories implement those functions differently
    <antrik> marcusb: do you know why this behavior (cat on directories) was changed?


# IRC, freenode, #hurd, 2011-07-13

A related issue:

    <braunr> rbraun@nordrassil:~$ vminfo $$ | wc -l
    <braunr> 1039
    <braunr> any idea why a shell would consume more than 1039 map entries ?
    <braunr> (well, not more actually)
    <braunr> even the kernel and ext2fs have around 100
    <braunr> (the kernel has actually only 23, which is very good and expected)
    <tschwinge> braunr: I agree that having some sort of debugging information
      for memory objects et al. would be quite hand.  To see where they're
      coming from, etc.
    <braunr> tschwinge: this would require naming objects at the mach level
    <braunr> e.g. when creating an object
    <braunr> giving it the path of a file for example
    <tschwinge> braunr: I have recently seen something (due to youpi fixing a
      bug) that bash is doing its own memory management.  Perhaps all these are
      such regions?
    <tschwinge> braunr: For example, yes.
    <braunr> what ?
    <braunr> ?!
    <tschwinge> braunr:
      http://lists.gnu.org/archive/html/bug-bash/2011-04/msg00097.html
    <braunr> i see

Also see email thread starting at [[!message-id
"20110714082216.GA8335@sceen.net"]].