1# vim:ts=4 2# 3# Copyright (c) 2002-2004 Hypertriton, Inc. <http://hypertriton.com/> 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright 12# notice, this list of conditions and the following disclaimer in the 13# documentation and/or other materials provided with the distribution. 14# 15# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 19# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 24# USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 26sub Test 27{ 28 TryCompile 'HAVE_STRLCPY', << 'EOF'; 29#include <string.h> 30int 31main(int argc, char *argv[]) 32{ 33 (void)strlcpy(NULL, NULL, 0); 34 return (0); 35} 36EOF 37} 38 39sub Emul 40{ 41 my ($os, $osrel, $machine) = @_; 42 43 MkEmulUnavailSYS('STRLCPY'); 44 return (1); 45} 46 47BEGIN 48{ 49 $DESCR{'strlcpy'} = 'a strlcpy() function'; 50 $TESTS{'strlcpy'} = \&Test; 51 $EMUL{'strlcpy'} = \&Emul; 52 $DEPS{'strlcpy'} = 'cc'; 53} 54 55;1 56