~ubuntu-branches/ubuntu/hardy/klibc/hardy-updates

« back to all changes in this revision

Viewing changes to ash/compat_linux.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeff Bailey
  • Date: 2006-01-04 20:24:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060104202452-ec4v3n829rymukuv
Tags: 1.1.15-0ubuntu1
* New upstream version.

* Patch to fix compilation on parisc64 kernels.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * compat.h
3
 
 *
4
 
 * Compability functions for Linux / Klibc
5
 
 */
6
 
 
7
 
#ifndef _LINUX_COMPAT_H
8
 
#define _LINUX_COMPAT_H
9
 
 
10
 
#define MAXPATHLEN PATH_MAX
11
 
 
12
 
#ifdef __KLIBC__
13
 
#define _PATH_TMP "/tmp/"
14
 
#endif /* __KLIBC__ */
15
 
 
16
 
#ifndef __KLIBC__
17
 
static inline size_t strlcpy ( char *             d,
18
 
                               const char *       s,
19
 
                               size_t     bufsize )     
20
 
{
21
 
    size_t len = strlen(s);
22
 
    size_t ret = len;
23
 
 
24
 
    if (bufsize <= 0) return 0;
25
 
    if (len >= bufsize) len = bufsize-1;
26
 
    memcpy(d, s, len);
27
 
    d[len] = 0;
28
 
    return ret;
29
 
}
30
 
#endif
31
 
 
32
 
#endif