19bda7d94SCeri Davies.\" 262486687SUlrich Spörlein.\" Copyright (c) 2003 Joseph Koshy <jkoshy@FreeBSD.org> 39bda7d94SCeri Davies.\" Copyright (c) 2006 Ceri Davies <ceri@FreeBSD.org> 49bda7d94SCeri Davies.\" 59bda7d94SCeri Davies.\" All rights reserved. 69bda7d94SCeri Davies.\" 79bda7d94SCeri Davies.\" Redistribution and use in source and binary forms, with or without 89bda7d94SCeri Davies.\" modification, are permitted provided that the following conditions 99bda7d94SCeri Davies.\" are met: 109bda7d94SCeri Davies.\" 1. Redistributions of source code must retain the above copyright 119bda7d94SCeri Davies.\" notice, this list of conditions and the following disclaimer. 129bda7d94SCeri Davies.\" 2. Redistributions in binary form must reproduce the above copyright 139bda7d94SCeri Davies.\" notice, this list of conditions and the following disclaimer in the 149bda7d94SCeri Davies.\" documentation and/or other materials provided with the distribution. 159bda7d94SCeri Davies.\" 169bda7d94SCeri Davies.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 179bda7d94SCeri Davies.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 189bda7d94SCeri Davies.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 199bda7d94SCeri Davies.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 209bda7d94SCeri Davies.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 219bda7d94SCeri Davies.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 229bda7d94SCeri Davies.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 239bda7d94SCeri Davies.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 249bda7d94SCeri Davies.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 259bda7d94SCeri Davies.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 269bda7d94SCeri Davies.\" 272ede38afSOlivier Certner.Dd August 18, 2023 289bda7d94SCeri Davies.Dt P_CANSEE 9 29aa12cea2SUlrich Spörlein.Os 309bda7d94SCeri Davies.Sh NAME 319bda7d94SCeri Davies.Nm p_cansee 329bda7d94SCeri Davies.Nd determine visibility of a process 339bda7d94SCeri Davies.Sh SYNOPSIS 349bda7d94SCeri Davies.In sys/proc.h 359bda7d94SCeri Davies.Ft int 369bda7d94SCeri Davies.Fn p_cansee "struct thread *td" "struct proc *p" 379bda7d94SCeri Davies.Sh DESCRIPTION 382ede38afSOlivier CertnerThis function determines if a given process 399bda7d94SCeri Davies.Fa p 409bda7d94SCeri Daviesis visible to the thread 419bda7d94SCeri Davies.Fa td , 429bda7d94SCeri Davieswhere the notion of 439bda7d94SCeri Davies.Dq visibility 449bda7d94SCeri Daviesmay be read as 459bda7d94SCeri Davies.Dq "awareness of existence" . 469bda7d94SCeri Davies.Pp 472ede38afSOlivier CertnerThis function explicitly allows a thread to always see its own process, 482ede38afSOlivier Certnereven with pending credentials changes 492ede38afSOlivier Certner.Po 502ede38afSOlivier Certnersee 512ede38afSOlivier Certner.Xr ucred 9 522ede38afSOlivier Certner.Pc . 532ede38afSOlivier CertnerOtherwise, it simply defers to 542ede38afSOlivier Certner.Xr cr_cansee 9 . 559bda7d94SCeri Davies.Sh RETURN VALUES 569bda7d94SCeri DaviesThe 579bda7d94SCeri Davies.Fn p_cansee 589bda7d94SCeri Daviesfunction 599bda7d94SCeri Daviesreturns 609bda7d94SCeri Davies.Li 0 619bda7d94SCeri Daviesif the process denoted by 629bda7d94SCeri Davies.Fa p 639bda7d94SCeri Daviesis visible by thread 649bda7d94SCeri Davies.Fa td , 652ede38afSOlivier Certneror ESRCH otherwise. 669bda7d94SCeri Davies.Sh ERRORS 679bda7d94SCeri Davies.Bl -tag -width Er 689bda7d94SCeri Davies.It Bq Er ESRCH 699bda7d94SCeri DaviesThread 709bda7d94SCeri Davies.Fa td 712ede38afSOlivier Certneris not part of process 729bda7d94SCeri Davies.Fa p 732ede38afSOlivier Certnerand cannot see it as determined by 742ede38afSOlivier Certner.Xr cr_cansee 9 . 759bda7d94SCeri Davies.El 769bda7d94SCeri Davies.Sh SEE ALSO 779bda7d94SCeri Davies.Xr cr_cansee 9 , 78*6e1fc011SGraham Percival.Xr p_candebug 9 , 79*6e1fc011SGraham Percival.Xr ucred 9 80