I am answering https://stackoverflow.com/users/10147399/aykhan-hagverdili since I don't have enough rep to comment:
creat is defined as:
SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)
{
int flags = O_CREAT | O_WRONLY | O_TRUNC;
if (force_o_largefile())
flags |= O_LARGEFILE;
return do_sys_open(AT_FDCWD, pathname, flags, mode);
}
whereas open is defined as:
SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode)
{
if (force_o_largefile())
flags |= O_LARGEFILE;
return do_sys_open(AT_FDCWD, filename, flags, mode);
}
SYSCALL_DEFINEX defines a syscall that takes in x arguments as input. It should be easy to see creat is just a specialized open with flags O_WRONLY|O_CREAT|O_TRUNC
References:
https://elixir.bootlin.com/linux/v6.13-rc3/source/fs/open.c#L1421
https://elixir.bootlin.com/linux/v6.13-rc3/source/fs/open.c#L1489