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


previous: >>108337962

#define __NR_creat                85

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

tl;dr:
create a file

this guy didn't get included in the open() thread 'cause i wasn't doing multiple at the time. so it gets its own thread! how exciting!
this syscall is LITERALLY completely pointless lol. it is just a wrapper around open. why the hell it exists, i have no idea. my guess (and the only sane justification) is that
O_CREAT
didn't exist at the time. now, is that actually the case? i don't know! i guess someone could look it up. but yeah, otherwise, waste of a syscall number

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/
>>
>make another syscall for file creation
>they make it non-batched again
At some point autism as pathology has to be entertained, screened for, and banned in any and all software development.
>>
File: 1772907471722583.jpg (77 KB, 640x694)
77 KB
77 KB JPG
>The creat() function is redundant. Its services are also provided by the open() function. It has been included primarily for historical purposes since many existing applications depend on it. It is best considered a part of the C binding rather than a function that should be provided in other languages.
what a redundant thread
>>
yeah i still want private lessons on syscalls
> why the hell it exists, i have no idea
sounds like another case of backward compatibility cruft
>>
>>108347474
ok, post contact info and i will reach out after i get off from work
>>
my favourite syscall is mmap :3
>>
File: 2025_09_27.jpg (997 KB, 2480x3506)
997 KB
997 KB JPG
>>108347804
omg that's my favorite too
>>
>>108347780
huh was it really that easy
>>
>>108347812
i like using it with MADV_WILLNEED to feed my program some extra ram as a treat
>>
>>108346314
The closest you'll get to batching is io_uring. Good luck with that though.
>>
>>108349337
Yeah, that's kind of my point. All the kernels are fucking shit because their developers are autistic to the max, and no one's talking about it.
>>
>>108346188
Literally why. This could've been a libc wrapper, there was absolutely no need to bloat the kernel with this.
At least they didn't bother implementing it on AArch64, only x86 is stuck with this bloat.
>>
File: win32u_dll.png (31 KB, 830x980)
31 KB
31 KB PNG
>>108350008
Oh, no. One wasted syscall number. Whatever shall we do.
>meanwhile, over on Windows NT
>>
File: file.png (16 KB, 597x115)
16 KB
16 KB PNG
>>108350064
>still on Windows 7
And meanwhile today they've deleted all those from the kernel, something Linux can never do because they stabilized the syscall interface and not dynamic libraries.
>>
File: gdi32.png (213 KB, 719x849)
213 KB
213 KB PNG
>>108350168
Oh shit, never mind.
>>
>>108350168
>Windows 7
The filename *IS* win32u_dll, isn't it.
>>
bampu
>>
>>108350168
Also it's not like the NTAPI isn't stabilized. The one thing they do *not* guarantee are static syscall numbers; you're supposed to use the stubs in NTDLL.DLL for those (or extract them from the binary and issue SYSCALLs on your own, and yes, I actually had a usecase that wasn't malware to do so).

But parameters? ABI? Function calls in and of themselves? Those are stable. And not only are they stable, but you should really, really, REALLY use them rather than the Win32 API, because the Win32 API sucks ass.
>you cannot imagine the userspace overhead for a simple CreateFileA
>and that's userspace overhead
>not like, shit that's done in the kernel
>if everything's warm and cached it's like 10% of the entire call
>and if not it's like 2000%
>true story
>>
>>108347902
i already said earlier i would talk to anyone who wanted to discuss the subject
i like syscalls, and those with similar interests
>>108348881
i like it cause it takes lots of arguments and is very useful
>>108350064
l o l
>>
bampu
>>
>>108350942
ok, i left it in the name field of the post you replied to
>>
>>108346844
OP is meticulous that way
>>
>>108350942
>i would talk to anyone who wanted to discuss the subject
have you done osdev?
>>108347804
>>108347812
lovely syscall indeed....
>>
>>108350929
>I actually had a usecase that wasn't malware to do so
how did that come to be? were you unable to source the headers for some platform your were compiling for?
>>
File: ntuserpeekmessage.png (39 KB, 1102x970)
39 KB
39 KB PNG
>>108352778
No, it was a syscall tracer that modified the stubs in NTDLL.DLL to jumps into my code. Problem was that the tracer itself relied on a couple syscalls, like
>NtAllocateVirtualMemoryEx
>NtClose
>NtCreateFile
>NtFreeVirtualMemory
>NtQueryInformationAtom
>NtWriteFile
, which then required my own stubs.
>>
>>108349337
What's wrong with io_uring? Or are you wanting bulk file creation transactions? (??)
>>
>>108353014
io_uring is a clusterfuck because they wanted userspace to be able to add new submissions to the ring while old ones were still being completed - when realistically they should've adopted front and back buffers instead, or, even better, not share control data with userspace in the first place.
>>
Ok, I admit it. You're the real regdumper.
>>
>>108353057
So you want transactions then not just batching.
>>
>>108353077
Not necessarily, no. I'd be fine with io_uring's model *if it worked, which it doesn't, as proven by the amount of CVEs it keeps generating*.

>>108353064
What?



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