4.115
Last change
on this file since fd2b1634 was
fd2b1634,
checked in by Sebastian Huber <sebastian.huber@…>, on 07/15/10 at 08:10:48
|
2010-07-16 Sebastian Huber <sebastian.huber@…>
- libcsupport/include/rtems/libio.h: Removed file_info and handlers
fields in rtems_libio_t.
- libcsupport/src/close.c, libcsupport/src/fcntl.c,
libcsupport/src/fdatasync.c, libcsupport/src/fstat.c,
libcsupport/src/fsync.c, libcsupport/src/ftruncate.c,
libcsupport/src/getdents.c, libcsupport/src/ioctl.c,
libcsupport/src/libio_sockets.c, libcsupport/src/lseek.c,
libcsupport/src/open.c, libcsupport/src/read.c,
libcsupport/src/readv.c, libcsupport/src/write.c,
libcsupport/src/writev.c, libfs/src/devfs/devclose.c,
libfs/src/devfs/devioctl.c, libfs/src/devfs/devopen.c,
libfs/src/devfs/devread.c, libfs/src/devfs/devwrite.c
libfs/src/dosfs/msdos_dir.c libfs/src/dosfs/msdos_file.c
libfs/src/imfs/deviceio.c libfs/src/imfs/imfs_directory.c
libfs/src/imfs/imfs_fifo.c libfs/src/imfs/memfile.c
libfs/src/nfsclient/src/nfs.c libfs/src/rfs/rtems-rfs-rtems-file.c
libfs/src/rfs/rtems-rfs-rtems.h libnetworking/lib/ftpfs.c: Reflect
changes above.
|
-
Property mode set to
100644
|
File size:
1003 bytes
|
Line | |
---|
1 | /* |
---|
2 | * close() - POSIX 1003.1b 6.3.1 - Close a File |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-1999. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #if HAVE_CONFIG_H |
---|
15 | #include "config.h" |
---|
16 | #endif |
---|
17 | |
---|
18 | #include <rtems/libio_.h> |
---|
19 | |
---|
20 | int close( |
---|
21 | int fd |
---|
22 | ) |
---|
23 | { |
---|
24 | rtems_libio_t *iop; |
---|
25 | rtems_status_code rc; |
---|
26 | |
---|
27 | rtems_libio_check_fd(fd); |
---|
28 | iop = rtems_libio_iop(fd); |
---|
29 | rtems_libio_check_is_open(iop); |
---|
30 | |
---|
31 | rc = RTEMS_SUCCESSFUL; |
---|
32 | rc = (*iop->pathinfo.handlers->close_h)( iop ); |
---|
33 | |
---|
34 | rtems_filesystem_freenode( &iop->pathinfo ); |
---|
35 | rtems_libio_free( iop ); |
---|
36 | |
---|
37 | return rc; |
---|
38 | } |
---|
39 | |
---|
40 | /* |
---|
41 | * _close_r |
---|
42 | * |
---|
43 | * This is the Newlib dependent reentrant version of close(). |
---|
44 | */ |
---|
45 | |
---|
46 | #if defined(RTEMS_NEWLIB) && !defined(HAVE__CLOSE_R) |
---|
47 | |
---|
48 | #include <reent.h> |
---|
49 | |
---|
50 | int _close_r( |
---|
51 | struct _reent *ptr __attribute__((unused)), |
---|
52 | int fd |
---|
53 | ) |
---|
54 | { |
---|
55 | return close( fd ); |
---|
56 | } |
---|
57 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.