text
stringlengths
0
234
shmp\->cnt = len;
memcpy(&shmp\->buf, string, len);
/* tell peer that it can now access shared memory. */
if (sem_post(&shmp\->sem1) == \-1)
errexit("sem_post");
/* wait until peer says that it has finished accessing
the shared memory. */
if (sem_wait(&shmp\->sem2) == \-1)
errexit("sem_wait");
/* write modified data in shared memory to standard output. */
write(stdout_fileno, &shmp\->buf, len);
write(stdout_fileno, "\en", 1);
exit(exit_success);
}
.ee
.in
.sh see also
.br close (2),
.br fchmod (2),
.br fchown (2),
.br fcntl (2),
.br fstat (2),
.br ftruncate (2),
.br memfd_create (2),
.br mmap (2),
.br open (2),
.br umask (2),
.br shm_overview (7)
.sh colophon
this page is part of release 5.13 of the linux
.i man-pages
project.
a description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
\%https://www.kernel.org/doc/man\-pages/.
.so man3/ether_aton.3
.so man3/strtod.3
.\" copyright (c) 2006 red hat, inc. all rights reserved.
.\" and copyright (c) 2013 michael kerrisk <[email protected]>
.\" written by ivana varekova <[email protected]>
.\"
.\" %%%license_start(verbatim)
.\" permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" since the linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. the author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. the author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%license_end
.\"
.th perfmonctl 2 2021-03-22 linux "linux programmer's manual"
.sh name
perfmonctl \- interface to ia-64 performance monitoring unit
.sh synopsis
.nf
.b #include <syscall.h>
.b #include <perfmon.h>
.pp
.bi "long perfmonctl(int " fd ", int " cmd ", void *" arg ", int " narg ");"
.fi
.pp
.ir note :
there is no glibc wrapper for this system call; see notes.
.sh description
the ia-64-specific
.br perfmonctl ()
system call provides an interface to the
pmu (performance monitoring unit).
the pmu consists of pmd (performance monitoring data) registers and
pmc (performance monitoring control) registers,
which gather hardware statistics.
.pp
.br perfmonctl ()
applies the operation
.i cmd