Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 2
    Invoking a system call directly involves loading one or more registers with values and executing an assembly instruction. You're not going to be able to do that directly from bash. Commented Nov 6, 2017 at 14:17
  • 1
    The most straight-forward way would be to write a small C program. Are you asking for a way to do this in pure Bash? Commented Nov 6, 2017 at 14:31
  • 1
    1. Why not use the library call wrapper - geteuid() - to the syscall - sys_geteuid() - in Linux? 2. Why do you want to use a syscall directly? Commented Nov 6, 2017 at 14:33
  • 1
    I do wonder what the purpose behind this is? It doesn't make much sense to manually make the system calls e.g. for copying a file, since you could use cp or cat directly. (And that's not even very hard to do on the system call level.) Is there some specific operation or system call you have in mind, or is this just about how system calls are made in general, or something else? Commented Nov 6, 2017 at 14:47
  • 4
    Why do you ask? Are you looking just for id command, or are you wanting to add a new system call into your kernel and asking how you would use it? Is the question specific to geteuid or generic to all system calls of syscalls(2)? Please edit your question to improve and motivate it! Commented Nov 6, 2017 at 14:51