DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: g

⟦3bd55576c⟧

    Length: 1927 (0x787)
    Names: »getcwd.3c«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./bsd/usr/man/cat3/getcwd.3c« 

Default Hex Dump

0x000…020 0a 0a 0a 5f 08 4f 5f 08 6e 5f 08 6c 5f 08 69 5f 08 6e 5f 08 65 20 5f 08 4d 5f 08 61 5f 08 6e 5f   ┆   _ O_ n_ l_ i_ n_ e _ M_ a_ n_┆
0x020…040 08 75 5f 08 61 5f 08 6c 20 20 20 20 20 20 20 20 20 20 20 4c 69 62 72 61 72 79 20 46 75 6e 63 74   ┆ u_ a_ l           Library Funct┆
0x040…060 69 6f 6e 73 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 74 63 77 64 28 33 63 29 0a 0a 0a 0a   ┆ions              getcwd(3c)    ┆
0x060…080 4e 08 4e 08 4e 08 4e 41 08 41 08 41 08 41 4d 08 4d 08 4d 08 4d 45 08 45 08 45 08 45 0a 20 20 20   ┆N N N NA A A AM M M ME E E E    ┆
0x080…0a0 20 20 67 65 74 63 77 64 20 2d 20 67 65 74 20 70 61 74 68 6e 61 6d 65 20 6f 66 20 63 75 72 72 65   ┆  getcwd - get pathname of curre┆
0x0a0…0c0 6e 74 20 77 6f 72 6b 69 6e 67 20 64 69 72 65 63 74 6f 72 79 0a 0a 53 08 53 08 53 08 53 59 08 59   ┆nt working directory  S S S SY Y┆
0x0c0…0e0 08 59 08 59 4e 08 4e 08 4e 08 4e 54 08 54 08 54 08 54 41 08 41 08 41 08 41 58 08 58 08 58 08 58   ┆ Y YN N N NT T T TA A A AX X X X┆
0x0e0…100 0a 20 20 20 20 20 63 08 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 61 72 08 72 08 72   ┆      c c c ch h h ha a a ar r r┆
0x100…120 08 72 20 2a 08 2a 08 2a 08 2a 67 08 67 08 67 08 67 65 08 65 08 65 08 65 74 08 74 08 74 08 74 63   ┆ r * * * *g g g ge e e et t t tc┆
0x120…140 08 63 08 63 08 63 77 08 77 08 77 08 77 64 08 64 08 64 08 64 20 28 08 28 08 28 08 28 62 08 62 08   ┆ c c cw w w wd d d d ( ( ( (b b ┆
0x140…160 62 08 62 75 08 75 08 75 08 75 66 08 66 08 66 08 66 2c 08 2c 08 2c 08 2c 20 73 08 73 08 73 08 73   ┆b bu u u uf f f f, , , , s s s s┆
0x160…180 69 08 69 08 69 08 69 7a 08 7a 08 7a 08 7a 65 08 65 08 65 08 65 29 08 29 08 29 08 29 0a 20 20 20   ┆i i i iz z z ze e e e) ) ) )    ┆
0x180…1a0 20 20 63 08 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 61 72 08 72 08 72 08 72 20 2a   ┆  c c c ch h h ha a a ar r r r *┆
0x1a0…1c0 08 2a 08 2a 08 2a 62 08 62 08 62 08 62 75 08 75 08 75 08 75 66 08 66 08 66 08 66 3b 08 3b 08 3b   ┆ * * *b b b bu u u uf f f f; ; ;┆
0x1c0…1e0 08 3b 0a 20 20 20 20 20 69 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 20 73 08   ┆ ;      i i i in n n nt t t t s ┆
0x1e0…200 73 08 73 08 73 69 08 69 08 69 08 69 7a 08 7a 08 7a 08 7a 65 08 65 08 65 08 65 3b 08 3b 08 3b 08   ┆s s si i i iz z z ze e e e; ; ; ┆
0x200…220 3b 0a 0a 44 08 44 08 44 08 44 45 08 45 08 45 08 45 53 08 53 08 53 08 53 43 08 43 08 43 08 43 52   ┆;  D D D DE E E ES S S SC C C CR┆
0x220…240 08 52 08 52 08 52 49 08 49 08 49 08 49 50 08 50 08 50 08 50 54 08 54 08 54 08 54 49 08 49 08 49   ┆ R R RI I I IP P P PT T T TI I I┆
0x240…260 08 49 4f 08 4f 08 4f 08 4f 4e 08 4e 08 4e 08 4e 0a 20 20 20 20 20 5f 08 67 5f 08 65 5f 08 74 5f   ┆ IO O O ON N N N      _ g_ e_ t_┆
0x260…280 08 63 5f 08 77 5f 08 64 20 72 65 74 75 72 6e 73 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68   ┆ c_ w_ d returns a pointer to th┆
0x280…2a0 65 20 63 75 72 72 65 6e 74 20 64 69 72 65 63 74 6f 72 79 20 70 61 74 68 2d 6e 61 6d 65 2e 0a 20   ┆e current directory path-name.  ┆
0x2a0…2c0 20 20 20 20 54 68 65 20 76 61 6c 75 65 20 6f 66 20 5f 08 73 5f 08 69 5f 08 7a 5f 08 65 20 6d 75   ┆    The value of _ s_ i_ z_ e mu┆
0x2c0…2e0 73 74 20 62 65 20 61 74 20 6c 65 61 73 74 20 74 77 6f 20 67 72 65 61 74 65 72 20 74 68 61 6e 20   ┆st be at least two greater than ┆
0x2e0…300 74 68 65 0a 20 20 20 20 20 6c 65 6e 67 74 68 20 6f 66 20 74 68 65 20 70 61 74 68 2d 6e 61 6d 65   ┆the      length of the path-name┆
0x300…320 20 74 6f 20 62 65 20 72 65 74 75 72 6e 65 64 2e 0a 0a 20 20 20 20 20 49 66 20 5f 08 62 5f 08 75   ┆ to be returned.       If _ b_ u┆
0x320…340 5f 08 66 20 69 73 20 61 20 4e 55 4c 4c 20 70 6f 69 6e 74 65 72 2c 20 5f 08 67 5f 08 65 5f 08 74   ┆_ f is a NULL pointer, _ g_ e_ t┆
0x340…360 5f 08 63 5f 08 77 5f 08 64 20 77 69 6c 6c 20 6f 62 74 61 69 6e 20 5f 08 73 5f 08 69 5f 08 7a 5f   ┆_ c_ w_ d will obtain _ s_ i_ z_┆
0x360…380 08 65 20 62 79 74 65 73 20 6f 66 0a 20 20 20 20 20 73 70 61 63 65 20 75 73 69 6e 67 20 5f 08 6d   ┆ e bytes of      space using _ m┆
0x380…3a0 5f 08 61 5f 08 6c 5f 08 6c 5f 08 6f 5f 08 63 28 33 43 29 2e 20 20 49 6e 20 74 68 69 73 20 63 61   ┆_ a_ l_ l_ o_ c(3C).  In this ca┆
0x3a0…3c0 73 65 2c 20 74 68 65 20 70 6f 69 6e 74 65 72 20 72 65 74 75 72 6e 65 64 0a 20 20 20 20 20 62 79   ┆se, the pointer returned      by┆
0x3c0…3e0 20 5f 08 67 5f 08 65 5f 08 74 5f 08 63 5f 08 77 5f 08 64 20 6d 61 79 20 62 65 20 75 73 65 64 20   ┆ _ g_ e_ t_ c_ w_ d may be used ┆
0x3e0…400 61 73 20 74 68 65 20 61 72 67 75 6d 65 6e 74 20 69 6e 20 61 20 73 75 62 73 65 71 75 65 6e 74 20   ┆as the argument in a subsequent ┆
0x400…420 63 61 6c 6c 0a 20 20 20 20 20 74 6f 20 5f 08 66 5f 08 72 5f 08 65 5f 08 65 2e 0a 0a 20 20 20 20   ┆call      to _ f_ r_ e_ e.      ┆
0x420…440 20 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 69 73 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 62 79 20   ┆ The function is implemented by ┆
0x440…460 75 73 69 6e 67 20 5f 08 70 5f 08 6f 5f 08 70 5f 08 65 5f 08 6e 28 33 53 29 20 74 6f 20 70 69 70   ┆using _ p_ o_ p_ e_ n(3S) to pip┆
0x460…480 65 20 74 68 65 0a 20 20 20 20 20 6f 75 74 70 75 74 20 6f 66 20 74 68 65 20 5f 08 70 5f 08 77 5f   ┆e the      output of the _ p_ w_┆
0x480…4a0 08 64 28 31 29 20 63 6f 6d 6d 61 6e 64 20 69 6e 74 6f 20 74 68 65 20 73 70 65 63 69 66 69 65 64   ┆ d(1) command into the specified┆
0x4a0…4c0 20 73 74 72 69 6e 67 0a 20 20 20 20 20 73 70 61 63 65 2e 0a 0a 45 08 45 08 45 08 45 58 08 58 08   ┆ string      space.  E E E EX X ┆
0x4c0…4e0 58 08 58 41 08 41 08 41 08 41 4d 08 4d 08 4d 08 4d 50 08 50 08 50 08 50 4c 08 4c 08 4c 08 4c 45   ┆X XA A A AM M M MP P P PL L L LE┆
0x4e0…500 08 45 08 45 08 45 0a 20 20 20 20 20 20 20 20 20 20 63 68 61 72 20 2a 63 77 64 2c 20 2a 67 65 74   ┆ E E E           char *cwd, *get┆
0x500…520 63 77 64 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 2e 0a 20 20 20 20 20 20 20 20 20 20 2e 0a 20   ┆cwd();           .           .  ┆
0x520…540 20 20 20 20 20 20 20 20 20 2e 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 63 77 64 20 3d 20   ┆         .           if ((cwd = ┆
0x540…560 67 65 74 63 77 64 28 28 63 68 61 72 20 2a 29 4e 55 4c 4c 2c 20 36 34 29 29 20 3d 3d 20 4e 55 4c   ┆getcwd((char *)NULL, 64)) == NUL┆
0x560…580 4c 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 65 72 72 6f 72 28 60 60 70 77 64   ┆L) {                perror(``pwd┆
0x580…5a0 27 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 78 69 74 28 31 29 3b 0a 20 20 20   ┆'');                exit(1);    ┆
0x5a0…5c0 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 70 72 69 6e 74 66 28 60 60 25 73 5c 6e   ┆       }           printf(``%s\n┆
0x5c0…5e0 27 27 2c 20 63 77 64 29 3b 0a 0a 53 08 53 08 53 08 53 45 08 45 08 45 08 45 45 08 45 08 45 08 45   ┆'', cwd);  S S S SE E E EE E E E┆
0x5e0…600 20 41 08 41 08 41 08 41 4c 08 4c 08 4c 08 4c 53 08 53 08 53 08 53 4f 08 4f 08 4f 08 4f 0a 20 20   ┆ A A A AL L L LS S S SO O O O   ┆
0x600…620 20 20 20 55 73 65 72 20 43 6f 6d 6d 61 6e 64 73 20 28 31 29 3a 20 20 70 77 64 0a 20 20 20 20 20   ┆   User Commands (1):  pwd      ┆
0x620…640 4c 69 62 72 61 72 79 20 46 75 6e 63 74 69 6f 6e 73 20 28 33 29 3a 20 20 6d 61 6c 6c 6f 63 2c 20   ┆Library Functions (3):  malloc, ┆
0x640…660 70 6f 70 65 6e 0a 0a 44 08 44 08 44 08 44 49 08 49 08 49 08 49 41 08 41 08 41 08 41 47 08 47 08   ┆popen  D D D DI I I IA A A AG G ┆
0x660…680 47 08 47 4e 08 4e 08 4e 08 4e 4f 08 4f 08 4f 08 4f 53 08 53 08 53 08 53 54 08 54 08 54 08 54 49   ┆G GN N N NO O O OS S S ST T T TI┆
0x680…6a0 08 49 08 49 08 49 43 08 43 08 43 08 43 53 08 53 08 53 08 53 0a 20 20 20 20 20 52 65 74 75 72 6e   ┆ I I IC C C CS S S S      Return┆
0x6a0…6c0 73 20 4e 08 4e 08 4e 08 4e 55 08 55 08 55 08 55 4c 08 4c 08 4c 08 4c 4c 08 4c 08 4c 08 4c 20 77   ┆s N N N NU U U UL L L LL L L L w┆
0x6c0…6e0 69 74 68 20 5f 08 65 5f 08 72 5f 08 72 5f 08 6e 5f 08 6f 20 73 65 74 20 69 66 20 5f 08 73 5f 08   ┆ith _ e_ r_ r_ n_ o set if _ s_ ┆
0x6e0…700 69 5f 08 7a 5f 08 65 20 69 73 20 6e 6f 74 20 6c 61 72 67 65 20 65 6e 6f 75 67 68 2c 20 6f 72 0a   ┆i_ z_ e is not large enough, or ┆
0x700…720 20 20 20 20 20 69 66 20 61 6e 20 65 72 72 6f 72 20 6f 63 75 72 72 73 20 69 6e 20 61 20 6c 6f 77   ┆     if an error ocurrs in a low┆
0x720…740 65 72 2d 6c 65 76 65 6c 20 66 75 6e 63 74 69 6f 6e 2e 0a 0a 4d 61 72 63 68 20 31 39 38 39 20 20   ┆er-level function.  March 1989  ┆
0x740…760 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 58 20 50   ┆                            TX P┆
0x760…780 72 6f 67 72 61 6d 6d 65 72 27 73 20 52 65 66 65 72 65 6e 63 65 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a   ┆rogrammer's Reference           ┆
0x780…787 0a 0a 0a 0a 0a 0a 0a                                                                              ┆       ┆