[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

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1773508469045851.jpg (388 KB, 850x850)
388 KB JPG
previous: >>108730420

#define __NR_time                    201

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

tl;dr:
get the time

wow, back to a one syscall day. how exciting!
this one's pretty neat in a few ways. one, it often doesn't even call into the kernel, instead opting for the vdso. the vdso itself it worth reading about if you're not already familiar: https://man7.org/linux/man-pages/man7/vdso.7.html
it's quite interesting
as someone mentioned a few threads back, the posix standard explicitly ignores leap seconds. rather interesting choice, but i guess it's mostly understandable given machine limitations
beyond this, i found the error section amusing
       Error returns from this system call are indistinguishable from
successful reports that the time is a few seconds before the
Epoch, so the C library wrapper function never sets errno as a
result of this call.

also, the part right below this about how it can never fail seems to conflict with the part about how it can fail with EOVERFLOW, but hey, what do i know?

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/
>>
bampu
>>
>>108737793
>the vdso itself it worth reading about if you're not already familiar: https://man7.org/linux/man-pages/man7/vdso.7.html
Doing that right now, thank you syscall anon and good thread as usual
>>
>>108737793
Upboat for better image than usual
>>
>>108737793
cute fleshlight
>>
File: file.png (196 KB, 346x417)
196 KB PNG
>>108739244
is she really?
>>
>>108738798
what are your thoughts?
glad you enjoy the threads, though
>>108739244
she is LITERALLY me
>>
>>108739718
are you a fleshlight
>>
>>108740530
.... maybe
>>
>>108740733
damn, must be nice
>>
Is this syscall limited to 32 bits on i386? Looks that way.
>>
>>108740822
could be worse i guess
>>
>>108739718
You are not a girl.
>>
>>108739718
You are a girl.
>>
File: sarah-415177-normal.jpg (44 KB, 355x500)
44 KB JPG
>>108739718
post syscalls that are literally you
>>
>>108739718
love u sycall anon
>>
>time() and time_t
>ftime() and struct timeb
>gettimeofday() and struct timeval
>clock_gettime() and struct timespec
imagine taking so many iterations to make a usable time interface
oh and kernel internally uses nanoseconds int64

anyway interesting fact about clock_gettime: there are some virtual clocks in /dev (e.g. PTP clocks) that you can use in place of the CLOCK_REALTIME or CLOCK_MONOTONIC enum
it's not a file descriptor directly, but somehow derived from it, don't recall exactly how
>>
>>108742023
yes i am
>>108742518
i know
>>108742522
most of the ones in pure love tier i think
https://desuarchive.org/g/thread/108323183/#108323759
maybe some in pure sex tier
i like pipe a lot, so that one definitely
>>108742531
ily2 anon
>>
>>108730420
god, I wish xattrs had first-class file system support. You can't use them, because programmes will randomly strip then whenever you perform file operations, so they get rarely used, so no one extends support, and on and on the cycle goes.
They're super handy for any sort of user-facing media, such as large image repositories. Such collections work much better with tags than with hierarchies, think of boorus, but you can't really use native Linux tagging because again, programmes will randomly nuke your entire tag db.
>>
>>108743960
Im gonna fill you with semen until you puke cum
>>
>>108745312
giwtwm
>>
>>108745934
Which one?
>>
>>108745958
the one being filled obviously
>>
>>108746706
wow cute there's two of us
>>
>>108742887
Yeah, C's time interface is a hot mess.
>>
>>108746706
>>108746916
that's gay unless you're a girl
>>
>>108747469
Being a girl is pretty gay.
>>
>>108747525
not true, you are not a girl but youre gay
>>
>>108737793
>rather interesting choice,
Not a choice, it's a pure counter. "Seconds since the epoch" doesn't include anything else.
>>
>>108747716
It was a choice to introduce discontinuities with UTC.
>>
>vdso
interesting stuff, didn't know that.
>>
>>108737793
Yesterday I was writing seccomp filters and caught syscalls I'd never heard of, the shmat family. I looked at the man page, and did not understand what it was for. I searched the internet, and still did not receive enlightenment. I then remembered these threads exist, and found it on the archives. It too did not explain why you would use it.
>>
>>108749636
lmao



[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.