Changeset 798b8da in rtems
- Timestamp:
- 12/10/13 01:53:13 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 371f32f4
- Parents:
- 967c1438 (diff), 663ffd0e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/arm/shared/include/linker-symbols.h
r967c1438 r798b8da 129 129 130 130 LINKER_SYMBOL(bsp_translation_table_base) 131 LINKER_SYMBOL(bsp_translation_table_end) 131 132 132 133 #define BSP_FAST_TEXT_SECTION __attribute__((section(".bsp_fast_text"))) -
cpukit/libcsupport/include/rtems/libio_.h
r967c1438 r798b8da 41 41 42 42 #define RTEMS_FILESYSTEM_SYMLOOP_MAX 32 43 44 /* 45 * Not defined in newlib so provide here. Users should use dup2 and 46 * not this non-portable fcntl command. Provided here to allow the 47 * RTEMS implementation to work. 48 */ 49 #define F_DUP2FD 20 43 50 44 51 /* -
cpukit/libcsupport/src/dup2.c
r967c1438 r798b8da 55 55 */ 56 56 57 return fcntl( fildes, F_DUP FD, fildes2 );57 return fcntl( fildes, F_DUP2FD, fildes2 ); 58 58 } -
cpukit/libcsupport/src/fcntl.c
r967c1438 r798b8da 25 25 #include <rtems/libio_.h> 26 26 27 static int duplicate_iop( rtems_libio_t *iop , int fd2)27 static int duplicate_iop( rtems_libio_t *iop ) 28 28 { 29 29 int rv = 0; 30 30 31 /*32 * FIXME: We ignore the start value fd2 for the file descriptor search. This33 * is not POSIX conform.34 */35 31 rtems_libio_t *diop = rtems_libio_allocate(); 36 32 … … 63 59 } 64 60 61 static int duplicate2_iop( rtems_libio_t *iop, int fd2 ) 62 { 63 rtems_libio_t *iop2; 64 int rv = 0; 65 66 rtems_libio_check_fd( fd2 ); 67 iop2 = rtems_libio_iop( fd2 ); 68 69 if (iop != iop2) 70 { 71 int oflag; 72 73 if ((iop2->flags & LIBIO_FLAGS_OPEN) != 0) { 74 rv = (*iop2->pathinfo.handlers->close_h)( iop2 ); 75 } 76 77 if (rv == 0) { 78 oflag = rtems_libio_to_fcntl_flags( iop->flags ); 79 oflag &= ~O_CREAT; 80 iop2->flags |= rtems_libio_fcntl_flags( oflag ); 81 82 rtems_filesystem_instance_lock( &iop->pathinfo ); 83 rtems_filesystem_location_clone( &iop2->pathinfo, &iop->pathinfo ); 84 rtems_filesystem_instance_unlock( &iop->pathinfo ); 85 86 /* 87 * XXX: We call the open handler here to have a proper open and close 88 * pair. 89 * 90 * FIXME: What to do with the path? 91 */ 92 rv = (*iop2->pathinfo.handlers->open_h)( iop2, NULL, oflag, 0 ); 93 if ( rv == 0 ) { 94 rv = fd2; 95 } 96 } 97 } 98 99 return rv; 100 } 101 65 102 static int vfcntl( 66 103 int fd, … … 89 126 switch ( cmd ) { 90 127 case F_DUPFD: /* dup */ 128 ret = duplicate_iop( iop ); 129 break; 130 131 case F_DUP2FD: /* dup2 */ 91 132 fd2 = va_arg( ap, int ); 92 ret = duplicate _iop( iop, fd2 );133 ret = duplicate2_iop( iop, fd2 ); 93 134 break; 94 135 -
cpukit/libfs/src/imfs/imfs_init.c
r967c1438 r798b8da 54 54 [IMFS_MEMORY_FILE] = &IMFS_node_control_memfile, 55 55 [IMFS_LINEAR_FILE] = &IMFS_node_control_linfile, 56 [IMFS_FIFO] = &IMFS_node_control_ default56 [IMFS_FIFO] = &IMFS_node_control_fifo 57 57 }; 58 58 -
cpukit/libfs/src/pipe/fifo.c
r967c1438 r798b8da 391 391 return -EINTR; 392 392 393 while (read < count) { 394 while (PIPE_EMPTY(pipe)) { 395 /* Not an error */ 396 if (pipe->Writers == 0) 397 goto out_locked; 398 399 if (LIBIO_NODELAY(iop)) { 400 ret = -EAGAIN; 401 goto out_locked; 402 } 403 404 /* Wait until pipe is no more empty or no writer exists */ 405 pipe->waitingReaders ++; 406 PIPE_UNLOCK(pipe); 407 if (! PIPE_READWAIT(pipe)) 408 ret = -EINTR; 409 if (! PIPE_LOCK(pipe)) { 410 /* WARN waitingReaders not restored! */ 411 ret = -EINTR; 412 goto out_nolock; 413 } 414 pipe->waitingReaders --; 415 if (ret != 0) 416 goto out_locked; 393 while (PIPE_EMPTY(pipe)) { 394 /* Not an error */ 395 if (pipe->Writers == 0) 396 goto out_locked; 397 398 if (LIBIO_NODELAY(iop)) { 399 ret = -EAGAIN; 400 goto out_locked; 417 401 } 418 402 419 /* Read chunk bytes */ 420 chunk = MIN(count - read, pipe->Length); 421 chunk1 = pipe->Size - pipe->Start; 422 if (chunk > chunk1) { 423 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); 424 memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); 403 /* Wait until pipe is no more empty or no writer exists */ 404 pipe->waitingReaders ++; 405 PIPE_UNLOCK(pipe); 406 if (! PIPE_READWAIT(pipe)) 407 ret = -EINTR; 408 if (! PIPE_LOCK(pipe)) { 409 /* WARN waitingReaders not restored! */ 410 ret = -EINTR; 411 goto out_nolock; 425 412 } 426 else 427 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); 428 429 pipe->Start += chunk; 430 pipe->Start %= pipe->Size; 431 pipe->Length -= chunk; 432 /* For buffering optimization */ 433 if (PIPE_EMPTY(pipe)) 434 pipe->Start = 0; 435 436 if (pipe->waitingWriters > 0) 437 PIPE_WAKEUPWRITERS(pipe); 438 read += chunk; 439 } 413 pipe->waitingReaders --; 414 if (ret != 0) 415 goto out_locked; 416 } 417 418 /* Read chunk bytes */ 419 chunk = MIN(count - read, pipe->Length); 420 chunk1 = pipe->Size - pipe->Start; 421 if (chunk > chunk1) { 422 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1); 423 memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1); 424 } 425 else 426 memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk); 427 428 pipe->Start += chunk; 429 pipe->Start %= pipe->Size; 430 pipe->Length -= chunk; 431 /* For buffering optimization */ 432 if (PIPE_EMPTY(pipe)) 433 pipe->Start = 0; 434 435 if (pipe->waitingWriters > 0) 436 PIPE_WAKEUPWRITERS(pipe); 437 read += chunk; 440 438 441 439 out_locked: -
cpukit/libnetworking/lib/syslog.c
r967c1438 r798b8da 143 143 myAddress.sin_family = AF_INET; 144 144 myAddress.sin_addr.s_addr = INADDR_ANY; 145 myAddress.sin_port = 0;145 myAddress.sin_port = htons (SYSLOG_PORT);; 146 146 memset (myAddress.sin_zero, '\0', sizeof myAddress.sin_zero); 147 147 if (bind (LogFd, (struct sockaddr *)&myAddress, sizeof (myAddress)) < 0) {
Note: See TracChangeset
for help on using the changeset viewer.