.\" $OpenBSD: msyscall.2,v 1.2 2019/11/27 20:53:05 schwarze Exp $ .\" .\" Copyright (c) 2019 Theo de Raadt .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: November 27 2019 $ .Dt MSYSCALL 2 .Os .Sh NAME .Nm msyscall .Nd permit syscalls from a region of pages .Sh SYNOPSIS .In sys/mman.h .Ft int .Fn msyscall "void *addr" "size_t len" .Sh DESCRIPTION The .Fn msyscall system call permits system call entry from the pages that contain the address range .Fa addr through .Fa addr \&+ .Fa len \- 1 (inclusive). If .Fa len is 0, no action is taken on the page that contains .Fa addr . .Pp .Nm is currently intended for use by .Xr ld.so 1 only, and may be called only once to indicate the location of the loaded .Pa libc.so library. .Sh RETURN VALUES .Rv -std .Sh ERRORS .Fn msyscall will fail if: .Bl -tag -width Er .It Bq Er EINVAL The specified address range would wrap around. .It Bq Er EPERM Attempt to call .Fn msyscall after .Xr ld.so 1 has called it. .El .Sh SEE ALSO .Xr mmap 2 .Sh HISTORY The .Fn msyscall function first appeared in .Ox 6.7 .