public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* syscall function is not syscall
@ 2020-11-16  6:47 sotrdg sotrdg
  2020-11-16 10:02 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: sotrdg sotrdg @ 2020-11-16  6:47 UTC (permalink / raw)
  To: libstdc++

syscall function will introduce dependency of libc and set errno which is a problem. It brings zero benefit compared to call these functions from glibc directly.

The correct method should be inline assembly

https://github.com/expnkx/fast_io/blob/master/include/fast_io_hosted/platforms/linux/amd64.h
https://github.com/expnkx/fast_io/blob/master/include/fast_io_hosted/platforms/linux/aarch64.h
https://github.com/expnkx/fast_io/blob/master/include/fast_io_hosted/platforms/linux/generic.h
https://github.com/expnkx/fast_io/blob/master/include/fast_io_hosted/platforms/linux/system_call.h


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: syscall function is not syscall
  2020-11-16  6:47 syscall function is not syscall sotrdg sotrdg
@ 2020-11-16 10:02 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2020-11-16 10:02 UTC (permalink / raw)
  To: sotrdg sotrdg; +Cc: libstdc++

On 16/11/20 06:47 +0000, sotrdg sotrdg via Libstdc++ wrote:
>syscall function will introduce dependency of libc and set errno which is a problem. It brings zero benefit compared to call these functions from glibc directly.

We use two syscalls, SYS_futex and SYS_clock_gettime.

SYS_futex cannot be called via glibc, because there is no futex
function.

SYS_clock_gettime is only use for old versions of glibc where the
clock_gettime function is not present in libc but in librt, which we
don't want to depend on.

So there are benefits, you're just not aware of them, and as usual
just state your opinion as fact. It's not helpful.

Also, both those syscalls were already being used, and are only used
when available, so they don't introduce any dependency on libc. That
dependency already exists.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-16 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  6:47 syscall function is not syscall sotrdg sotrdg
2020-11-16 10:02 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).