1139776Simp/*-
216476Sdyson * Copyright (c) 1993 Jan-Simon Pendry
316476Sdyson * Copyright (c) 1993
416476Sdyson *	The Regents of the University of California.  All rights reserved.
516476Sdyson *
616476Sdyson * This code is derived from software contributed to Berkeley by
716476Sdyson * Jan-Simon Pendry.
816476Sdyson *
916476Sdyson * Redistribution and use in source and binary forms, with or without
1016476Sdyson * modification, are permitted provided that the following conditions
1116476Sdyson * are met:
1216476Sdyson * 1. Redistributions of source code must retain the above copyright
1316476Sdyson *    notice, this list of conditions and the following disclaimer.
1416476Sdyson * 2. Redistributions in binary form must reproduce the above copyright
1516476Sdyson *    notice, this list of conditions and the following disclaimer in the
1616476Sdyson *    documentation and/or other materials provided with the distribution.
1716476Sdyson * 4. Neither the name of the University nor the names of its contributors
1816476Sdyson *    may be used to endorse or promote products derived from this software
1916476Sdyson *    without specific prior written permission.
2016476Sdyson *
2116476Sdyson * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2216476Sdyson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2316476Sdyson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2416476Sdyson * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2516476Sdyson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2616476Sdyson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2716476Sdyson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2816476Sdyson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2916476Sdyson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3016476Sdyson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3116476Sdyson * SUCH DAMAGE.
3216476Sdyson *
3350477Speter * $FreeBSD: releng/11.0/sys/fs/procfs/procfs_type.c 209062 2010-06-11 19:27:21Z avg $
3416476Sdyson */
3516476Sdyson
3616476Sdyson#include <sys/param.h>
3716476Sdyson#include <sys/systm.h>
3816476Sdyson#include <sys/proc.h>
3987321Sdes#include <sys/sbuf.h>
4016476Sdyson#include <sys/sysent.h>
4187321Sdes
4287321Sdes#include <fs/pseudofs/pseudofs.h>
4377031Sru#include <fs/procfs/procfs.h>
4416476Sdyson
4516476Sdysonint
4687321Sdesprocfs_doproctype(PFS_FILL_ARGS)
4716476Sdyson{
4887321Sdes	static const char *none = "Not Available";
4916476Sdyson
50123247Sdes	if (p != NULL && p->p_sysent && p->p_sysent->sv_name)
51209062Savg		sbuf_printf(sb, "%s", p->p_sysent->sv_name);
52123247Sdes	else
53209062Savg		sbuf_printf(sb, "%s", none);
5487321Sdes	sbuf_putc(sb, '\n');
5587321Sdes	return (0);
5616476Sdyson}
57