[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1hu1la12j8mg1.jpg (70 KB, 1320x777)
70 KB
70 KB JPG
previous: >>108310106

#define __NR_getcwd                79

https://man7.org/linux/man-pages/man2/getcwd.2.html

tl;dr:
get your current working directory (lol)

this guy doesn't even have a real section 2 entry...
the (unreachable) bit is pretty interesting. other than that, though, mostly a boring syscall superceded by the ability to open a dirfd on "." and later fchdir to it. nice for shell use, i guess

relevant resources:
man man

man syscalls

https://man7.org/linux/man-pages/
https://linux.die.net/man/
https://elixir.bootlin.com/linux/
https://elixir.bootlin.com/musl/
https://elixir.bootlin.com/glibc/
>>
marina is cute
>>
>>108316723
No usecase. If knowing the current directory matters to your program, you did something wrong.
>>
>>108316809
i mean, it definitely matters for shells
>>
OP is totally kissable
>>
File: 1771753551593775.png (87 KB, 1029x1058)
87 KB
87 KB PNG
>>108316931
this is much better than >>108310122 so thank you!
>>
>>108263011
>>
File: 1769190081024457.png (120 KB, 410x478)
120 KB
120 KB PNG
>>108317070
that one is also pretty lewd lol
sex is bad and evil!!!
>>
>>108317053
i hope you blush or make funny sounds every time you read some other anon reply to your posts like this
>>
>>108316815
IIRC they do their own bookkeeping in order to remember which symlinks you used to get to where you are
And then I guess they do some extra bullshit so that cd .. does what you expect? Never thought about it
pwd(1) has a flag to decide whether to print the physical cwd or the logical cwd inherited from the shell's env var
>>
File: 1769956682984757.jpg (44 KB, 460x460)
44 KB
44 KB JPG
>>108317209
>>
>>108317673
seems like a lot of bookkeeping for a shell to manage...
>>
File: 1766981681918132.jpg (38 KB, 720x720)
38 KB
38 KB JPG
>>108316809
>my labmates chdir inside python functions all the time
>get offended when I say it's retarded
>>
weak shit
>program arguments as program input
>std in as program input
>config files as program input
>GUI as program input
real shit
>program input is the name of the working directory folder
>>
>>108310122
>>108263011
>>108317053
QRD me, is OP a woman?
>>
File: 1771088745747794.gif (492 KB, 540x540)
492 KB
492 KB GIF
>>108320673
wh-why would you ever do this...
>>108320678
maybe...
>>
>>108320678
op is cute which is more important
>>
File: 1771999636742349.jpg (32 KB, 383x592)
32 KB
32 KB JPG
>>108320811
n-no... that's not how it works...
>>
>>108321051
that's literally how it works for me
>>
>>108316752
Asya mogs
>>
>>108319100
it is a shell after all, they've a lot to juggle
>>
>>108322039
haha, that's fair
>>108321164
very interesting.......
>>
>>108323187
oh you're back
what's your job?
>>
>>108316723
zato
>>
>>108323228
i'm a software developer, as one might expect
>>
>>108321439
True that



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.