Add support for dup2'ing files. Infrastructure and ROMFS done. Still need FAT, BINFS, NXFFS, and NFS
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5516 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
65c2f3e7ff
commit
9fdccfccfa
@ -466,3 +466,4 @@
|
|||||||
death-of-child signals (SIGCHLD).
|
death-of-child signals (SIGCHLD).
|
||||||
* apps/examples/ostest/waitpid.c: Add a test for waitpid(), waitid(),
|
* apps/examples/ostest/waitpid.c: Add a test for waitpid(), waitid(),
|
||||||
and wait().
|
and wait().
|
||||||
|
* builtin/binfs.c: Add hooks for dup() method (not implemented).
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/builtin/binfs.c
|
* apps/builtin/binfs.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -118,7 +118,9 @@ const struct mountpt_operations binfs_operations =
|
|||||||
NULL, /* write */
|
NULL, /* write */
|
||||||
NULL, /* seek */
|
NULL, /* seek */
|
||||||
binfs_ioctl, /* ioctl */
|
binfs_ioctl, /* ioctl */
|
||||||
|
|
||||||
NULL, /* sync */
|
NULL, /* sync */
|
||||||
|
NULL, /* dup */
|
||||||
|
|
||||||
binfs_opendir, /* opendir */
|
binfs_opendir, /* opendir */
|
||||||
NULL, /* closedir */
|
NULL, /* closedir */
|
||||||
|
@ -89,15 +89,6 @@
|
|||||||
# error "You must not disable loadable modules via CONFIG_BINFMT_DISABLE in your configuration file"
|
# error "You must not disable loadable modules via CONFIG_BINFMT_DISABLE in your configuration file"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The redirection test does not work. This is because it tries to redirect
|
|
||||||
* file as stdin. That won't work now because (1) the file descriptors must
|
|
||||||
* be dup'ed when the new task is created, and (2) there is no support in
|
|
||||||
* place for dup'ing file descriptors for anything other than sockets and
|
|
||||||
* character drivers. This is a bug!
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define FILE_DUP_BUG 1
|
|
||||||
|
|
||||||
/* Describe the ROMFS file system */
|
/* Describe the ROMFS file system */
|
||||||
|
|
||||||
#define SECTORSIZE 512
|
#define SECTORSIZE 512
|
||||||
@ -147,9 +138,7 @@ static unsigned int g_mmstep; /* Memory Usage at beginning of test step */
|
|||||||
|
|
||||||
static const char delimiter[] =
|
static const char delimiter[] =
|
||||||
"****************************************************************************";
|
"****************************************************************************";
|
||||||
#ifndef FILE_DUP_BUG
|
|
||||||
static const char g_redirect[] = "redirect";
|
static const char g_redirect[] = "redirect";
|
||||||
#endif
|
|
||||||
static const char g_hello[] = "hello";
|
static const char g_hello[] = "hello";
|
||||||
static const char g_data[] = "testdata.txt";
|
static const char g_data[] = "testdata.txt";
|
||||||
|
|
||||||
@ -375,8 +364,6 @@ int spawn_main(int argc, char *argv[])
|
|||||||
* Case 2: Simple program with redirection of stdin to a file input
|
* Case 2: Simple program with redirection of stdin to a file input
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#ifndef FILE_DUP_BUG
|
|
||||||
|
|
||||||
/* Output a seperated so that we can clearly discriminate the output of
|
/* Output a seperated so that we can clearly discriminate the output of
|
||||||
* this program from the others.
|
* this program from the others.
|
||||||
*/
|
*/
|
||||||
@ -463,7 +450,6 @@ int spawn_main(int argc, char *argv[])
|
|||||||
posix_spawnattr_dump(&attr);
|
posix_spawnattr_dump(&attr);
|
||||||
|
|
||||||
mm_update(&g_mmstep, "after file_action/attr destruction");
|
mm_update(&g_mmstep, "after file_action/attr destruction");
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Clean-up */
|
/* Clean-up */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user