Changeset 933388ae in rtems


Ignore:
Timestamp:
Apr 22, 1999, 9:13:23 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
16a384cf
Parents:
3599c5e
Message:

Added lstat().

Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/src/stat.c

    r3599c5e r933388ae  
    11/*
    22 *  stat() - POSIX 1003.1b 5.6.2 - Get File Status
     3 *
     4 *  Reused from lstat().
    35 *
    46 *  COPYRIGHT (c) 1989-1998.
     
    1214 *  $Id$
    1315 */
     16
     17/*
     18 *  lstat() and stat() share the same implementation with a minor
     19 *  difference on how links are evaluated.
     20 */
     21
     22#ifndef _STAT_NAME
     23#define _STAT_NAME         stat
     24#define _STAT_R_NAME       _stat_r
     25#define _STAT_FOLLOW_LINKS TRUE
     26#endif
     27
    1428
    1529#include <rtems.h>
     
    2640#include "libio_.h"
    2741
    28 int stat(
     42int _STAT_NAME(
    2943  const char  *path,
    3044  struct stat *buf
     
    4155    set_errno_and_return_minus_one( EFAULT );
    4256
    43   status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE );
     57  status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS );
    4458  if ( status != 0 )
    4559    return -1;
     
    6074
    6175/*
    62  *  _stat_r
     76 *  _stat_r, _lstat_r
    6377 *
    64  *  This is the Newlib dependent reentrant version of stat().
     78 *  This is the Newlib dependent reentrant version of stat() and lstat().
    6579 */
    6680
     
    6983#include <reent.h>
    7084
    71 int _stat_r(
     85int _STAT_R_NAME(
    7286  struct _reent *ptr,
    7387  const char    *path,
     
    7589)
    7690{
    77   return stat( path, buf );
     91  return _STAT_NAME( path, buf );
    7892}
    7993#endif
  • c/src/lib/libc/Makefile.in

    r3599c5e r933388ae  
    4848LIBC_GLUE_PIECES=\
    4949  __gettod __times \
    50   truncate access stat pathconf \
     50  truncate access stat lstat pathconf \
    5151  newlibc no_libc
    5252
  • c/src/lib/libc/stat.c

    r3599c5e r933388ae  
    11/*
    22 *  stat() - POSIX 1003.1b 5.6.2 - Get File Status
     3 *
     4 *  Reused from lstat().
    35 *
    46 *  COPYRIGHT (c) 1989-1998.
     
    1214 *  $Id$
    1315 */
     16
     17/*
     18 *  lstat() and stat() share the same implementation with a minor
     19 *  difference on how links are evaluated.
     20 */
     21
     22#ifndef _STAT_NAME
     23#define _STAT_NAME         stat
     24#define _STAT_R_NAME       _stat_r
     25#define _STAT_FOLLOW_LINKS TRUE
     26#endif
     27
    1428
    1529#include <rtems.h>
     
    2640#include "libio_.h"
    2741
    28 int stat(
     42int _STAT_NAME(
    2943  const char  *path,
    3044  struct stat *buf
     
    4155    set_errno_and_return_minus_one( EFAULT );
    4256
    43   status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE );
     57  status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS );
    4458  if ( status != 0 )
    4559    return -1;
     
    6074
    6175/*
    62  *  _stat_r
     76 *  _stat_r, _lstat_r
    6377 *
    64  *  This is the Newlib dependent reentrant version of stat().
     78 *  This is the Newlib dependent reentrant version of stat() and lstat().
    6579 */
    6680
     
    6983#include <reent.h>
    7084
    71 int _stat_r(
     85int _STAT_R_NAME(
    7286  struct _reent *ptr,
    7387  const char    *path,
     
    7589)
    7690{
    77   return stat( path, buf );
     91  return _STAT_NAME( path, buf );
    7892}
    7993#endif
  • cpukit/libcsupport/src/stat.c

    r3599c5e r933388ae  
    11/*
    22 *  stat() - POSIX 1003.1b 5.6.2 - Get File Status
     3 *
     4 *  Reused from lstat().
    35 *
    46 *  COPYRIGHT (c) 1989-1998.
     
    1214 *  $Id$
    1315 */
     16
     17/*
     18 *  lstat() and stat() share the same implementation with a minor
     19 *  difference on how links are evaluated.
     20 */
     21
     22#ifndef _STAT_NAME
     23#define _STAT_NAME         stat
     24#define _STAT_R_NAME       _stat_r
     25#define _STAT_FOLLOW_LINKS TRUE
     26#endif
     27
    1428
    1529#include <rtems.h>
     
    2640#include "libio_.h"
    2741
    28 int stat(
     42int _STAT_NAME(
    2943  const char  *path,
    3044  struct stat *buf
     
    4155    set_errno_and_return_minus_one( EFAULT );
    4256
    43   status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE );
     57  status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS );
    4458  if ( status != 0 )
    4559    return -1;
     
    6074
    6175/*
    62  *  _stat_r
     76 *  _stat_r, _lstat_r
    6377 *
    64  *  This is the Newlib dependent reentrant version of stat().
     78 *  This is the Newlib dependent reentrant version of stat() and lstat().
    6579 */
    6680
     
    6983#include <reent.h>
    7084
    71 int _stat_r(
     85int _STAT_R_NAME(
    7286  struct _reent *ptr,
    7387  const char    *path,
     
    7589)
    7690{
    77   return stat( path, buf );
     91  return _STAT_NAME( path, buf );
    7892}
    7993#endif
Note: See TracChangeset for help on using the changeset viewer.