/* $NetBSD: dirname.c,v 1.3 2001/09/15 15:43:40 simonb Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Klaus Klein. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: dirname.c,v 1.3 2001/09/15 15:43:40 simonb Exp $"); #endif /* !LIBC_SCCS && !lint */ #include "namespace.h" #include #include #ifdef __weak_alias __weak_alias(dirname,_dirname) #endif char * dirname(path) char *path; { static char singledot[] = "."; char *p; /* * If `path' is a null pointer or points to an empty string, or does * not contain a '/', return a pointer to the string ".". */ if ((path == NULL) || (*path == '\0') || (strchr(path, '/') == NULL)) return (singledot); /* Strip trailing slashes, if any. */ p = path + strlen(path) - 1; while (*p == '/' && p != path) *p-- = '\0'; /* Terminate path at the last occurence of '/'. */ if ((p = strrchr(path, '/')) != NULL) *(p + (p == path ? 1 : 0)) = '\0'; return (path); } /net/lib/libnetinet6?id=e679d8442cd6660559ea0efb725e05c366e356bc&showmsg=1'>libnetinet6
AgeCommit message (Collapse)Author
2018-02-08Move udp6_output() into udp6_usrreq.c, and remove udp6_output.c. This ismaxv
more consistent with IPv4, and there is no good reason for keeping a separate file only for one function. FreeBSD did the same.
2017-04-14Rumpify netipsecozaki-r
Note that we should modularize netipsec and reduce reverse symbol references (referencing symbols of netipsec from net, netinet and netinet6) though, the task needs lots of code changes. Prior to doing so, rumpifying it and having ATF tests should be useful.
2016-08-13Don't call loopinit() here. Instead panic if -lrumpnet_net has not beenchristos
called to initialize lo0ifp.
2016-08-12more loopinit();christos
2016-01-26Put the kernelside rump kernel headers into <rump-sys> instead ofpooka
sprinkling them around the faction directories. Avoids having to add a CPPFLAGS (or several) to pretty much every component Makefile. Leave compat headers around in the old locations. The commit changes some autogenerated files, but I'll fix the generators shortly and regen.
2015-10-19Add a COMMENT describing what each component roughly does.pooka
"make describe" prints the comment. Requested/inspired by Vincent Schwarzer on rumpkernel-users
2015-08-25some final -Ifoo/opt removalpooka
2015-01-18Move defines of INET and INET6 from opt_inet.h to Makefile.incjustin
As discussed with pooka@ fixes current issues with ipv6 on rump being broken
2014-12-02Remove shlib_version files and just use Makefile SHLIB_MAJOR/MINOR,pooka
with the default provided by Makefile.rump (they're all 0.0 anyway)
2014-08-22Nuke the DOMAINADD() macro and just call domain_attach(), now that thingspooka
work correctly that way.
2014-06-05- Implement pktqueue interface for lockless IP input queue.rmind
- Replace ipintrq and ip6intrq with the pktqueue mechanism. - Eliminate kernel-lock from ipintr() and ip6intr(). - Some preparation work to push softnet_lock out of ipintr(). Discussed on tech-net.
2014-03-13rename component.c -> netinet6_component.cpooka
2014-02-14Register netisr's from component constructors instead of via a hardcodedpooka
global list.
2014-01-02Allow kernels compiled with INET+INET6 to be booted as IPv4-only or IPv6-only.pooka
2013-08-14Partially revert previous, there are still a few gotchas inpooka
running ipv4/ipv6-only (too many dependencies on ifdefs).
2013-08-14Separate inet and inet6, allows inet6-only rump kernels.pooka