From owner-svn-src-head@FreeBSD.ORG Tue Jan 27 00:22:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9ECF1065673; Tue, 27 Jan 2009 00:22:16 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DAC38FC1A; Tue, 27 Jan 2009 00:22:16 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0R0MGDr067549; Tue, 27 Jan 2009 00:22:16 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0R0MGin067548; Tue, 27 Jan 2009 00:22:16 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200901270022.n0R0MGin067548@svn.freebsd.org> From: Tom Rhodes Date: Tue, 27 Jan 2009 00:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187746 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2009 00:22:17 -0000 Author: trhodes Date: Tue Jan 27 00:22:16 2009 New Revision: 187746 URL: http://svn.freebsd.org/changeset/base/187746 Log: Add ENOMEM to the return values. Remove invalid return values. Remove reference to non-existent manual pages. Remove reference to rfork (it does not discuss RFSTOPPED). Add sys/unistd.h to the list of includes (required for RFSTOPPED). PR: 126227 Submitted by: Mateusz Guzik (based on, original version) Reviewed by: jhb, Christoph Mallon Modified: head/share/man/man9/kthread.9 Modified: head/share/man/man9/kthread.9 ============================================================================== --- head/share/man/man9/kthread.9 Mon Jan 26 23:17:19 2009 (r187745) +++ head/share/man/man9/kthread.9 Tue Jan 27 00:22:16 2009 (r187746) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2007 +.Dd January 26, 2009 .Dt KTHREAD 9 .Os .Sh NAME @@ -43,12 +43,6 @@ .Fn kthread_start "const void *udata" .Ft void .Fn kthread_shutdown "void *arg" "int howto" -.Ft int -.Fo kthread_add -.Fa "void (*func)(void *)" "void *arg" "struct proc *procp" -.Fa "struct thread **newtdpp" "int flags" "int pages" -.Fa "const char *fmt" ... -.Fc .Ft void .Fn kthread_exit "void" .Ft int @@ -57,6 +51,13 @@ .Fn kthread_suspend "struct thread *td" "int timo" .Ft void .Fn kthread_suspend_check "struct thread *td" +.In sys/unistd.h +.Ft int +.Fo kthread_add +.Fa "void (*func)(void *)" "void *arg" "struct proc *procp" +.Fa "struct thread **newtdpp" "int flags" "int pages" +.Fa "const char *fmt" ... +.Fc .Ft int .Fo kproc_kthread_add .Fa "void (*func)(void *)" "void *arg" @@ -142,8 +143,12 @@ If this argument is then it is ignored. The .Fa flags -argument specifies a set of flags as described in -.Xr rfork 2 . +argument may be set to +.Dv RFSTOPPED +to leave the thread in a stopped state. +The caller must call +.Fn sched_add +to start the thread. The .Fa pages argument specifies the size of the new kernel thread's stack in pages. @@ -274,23 +279,10 @@ The .Fn kthread_add function will fail if: .Bl -tag -width Er -.It Bq Er EAGAIN -The system-imposed limit on the total -number of processes under execution would be exceeded. -The limit is given by the -.Xr sysctl 3 -MIB variable -.Dv KERN_MAXPROC . -.It Bq Er EINVAL -The -.Dv RFCFDG -flag was specified in the -.Fa flags -parameter. +.It Bq Er ENOMEM +Memory for a thread's stack could not be allocated. .El .Sh SEE ALSO -.Xr rfork 2 , -.Xr exit1 9 , .Xr kproc 9 , .Xr SYSINIT 9 , .Xr wakeup 9