Changeset ab3a851 in mainline for uspace/srv
- Timestamp:
- 2010-11-30T00:50:25Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b2981aa
- Parents:
- 178673c (diff), 41a7f62 (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. - Location:
- uspace/srv
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/ata_bd/ata_bd.c
r178673c rab3a851 113 113 printf(NAME ": ATA disk driver\n"); 114 114 115 printf("I/O address %p/%p\n", ctl_physical, cmd_physical); 115 printf("I/O address %p/%p\n", (void *) ctl_physical, 116 (void *) cmd_physical); 116 117 117 118 if (ata_bd_init() != EOK) … … 181 182 } 182 183 183 printf(" %" PRIu64 " blocks", d->blocks , d->blocks / (2 * 1024));184 printf(" %" PRIu64 " blocks", d->blocks); 184 185 185 186 mbytes = d->blocks / (2 * 1024); -
uspace/srv/bd/file_bd/file_bd.c
r178673c rab3a851 56 56 #define NAME "file_bd" 57 57 58 static const size_t block_size = 512; 58 #define DEFAULT_BLOCK_SIZE 512 59 60 static size_t block_size; 59 61 static aoff64_t num_blocks; 60 62 static FILE *img; … … 63 65 static fibril_mutex_t dev_lock; 64 66 67 static void print_usage(void); 65 68 static int file_bd_init(const char *fname); 66 69 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall); … … 71 74 { 72 75 int rc; 76 char *image_name; 77 char *device_name; 73 78 74 79 printf(NAME ": File-backed block device driver\n"); 75 80 76 if (argc != 3) { 77 printf("Expected two arguments (image name, device name).\n"); 81 block_size = DEFAULT_BLOCK_SIZE; 82 83 ++argv; --argc; 84 while (*argv != NULL && (*argv)[0] == '-') { 85 /* Option */ 86 if (str_cmp(*argv, "-b") == 0) { 87 if (argc < 2) { 88 printf("Argument missing.\n"); 89 print_usage(); 90 return -1; 91 } 92 93 rc = str_size_t(argv[1], NULL, 10, true, &block_size); 94 if (rc != EOK || block_size == 0) { 95 printf("Invalid block size '%s'.\n", argv[1]); 96 print_usage(); 97 return -1; 98 } 99 ++argv; --argc; 100 } else { 101 printf("Invalid option '%s'.\n", *argv); 102 print_usage(); 103 return -1; 104 } 105 ++argv; --argc; 106 } 107 108 if (argc < 2) { 109 printf("Missing arguments.\n"); 110 print_usage(); 78 111 return -1; 79 112 } 80 113 81 if (file_bd_init(argv[1]) != EOK) 114 image_name = argv[0]; 115 device_name = argv[1]; 116 117 if (file_bd_init(image_name) != EOK) 82 118 return -1; 83 119 84 rc = devmap_device_register( argv[2], &devmap_handle);120 rc = devmap_device_register(device_name, &devmap_handle); 85 121 if (rc != EOK) { 86 122 devmap_hangup_phone(DEVMAP_DRIVER); 87 printf(NAME ": Unable to register device %s.\n",88 argv[2]);123 printf(NAME ": Unable to register device '%s'.\n", 124 device_name); 89 125 return rc; 90 126 } … … 96 132 /* Not reached */ 97 133 return 0; 134 } 135 136 static void print_usage(void) 137 { 138 printf("Usage: " NAME " [-b <block_size>] <image_file> <device_name>\n"); 98 139 } 99 140 -
uspace/srv/bd/part/guid_part/guid_part.c
r178673c rab3a851 155 155 156 156 if (block_size < 512 || (block_size % 512) != 0) { 157 printf(NAME ": invalid block size % d.\n");157 printf(NAME ": invalid block size %zu.\n", block_size); 158 158 return ENOTSUP; 159 159 } -
uspace/srv/bd/part/mbr_part/mbr_part.c
r178673c rab3a851 206 206 207 207 if (block_size < 512 || (block_size % 512) != 0) { 208 printf(NAME ": invalid block size % d.\n");208 printf(NAME ": invalid block size %zu.\n", block_size); 209 209 return ENOTSUP; 210 210 } -
uspace/srv/bd/rd/rd.c
r178673c rab3a851 230 230 } 231 231 232 printf("%s: Found RAM disk at %p, %d bytes\n", NAME, rd_ph_addr, rd_size); 232 printf("%s: Found RAM disk at %p, %zu bytes\n", NAME, 233 (void *) rd_ph_addr, rd_size); 233 234 234 235 int rc = devmap_driver_register(NAME, rd_connection); -
uspace/srv/clip/clip.c
r178673c rab3a851 172 172 break; 173 173 default: 174 if (!(callid & IPC_CALLID_NOTIFICATION)) 175 ipc_answer_0(callid, ENOENT); 174 ipc_answer_0(callid, ENOENT); 176 175 } 177 176 } -
uspace/srv/devman/devman.c
r178673c rab3a851 1020 1020 1021 1021 size_t idx = get_new_class_dev_idx(cl); 1022 asprintf(&dev_name, "%s% d", base_name, idx);1022 asprintf(&dev_name, "%s%zu", base_name, idx); 1023 1023 1024 1024 return dev_name; -
uspace/srv/devman/main.c
r178673c rab3a851 36 36 */ 37 37 38 #include <inttypes.h> 38 39 #include <assert.h> 39 40 #include <ipc/services.h> … … 405 406 break; 406 407 default: 407 if (!(callid & IPC_CALLID_NOTIFICATION)) 408 ipc_answer_0(callid, ENOENT); 408 ipc_answer_0(callid, ENOENT); 409 409 } 410 410 } … … 418 418 node_t *dev = find_dev_node(&device_tree, handle); 419 419 if (dev == NULL) { 420 printf(NAME ": devman_forward error - no device with handle % x "421 " was found.\n", handle);420 printf(NAME ": devman_forward error - no device with handle %" PRIun 421 " was found.\n", handle); 422 422 ipc_answer_0(iid, ENOENT); 423 423 return; … … 435 435 436 436 if (driver == NULL) { 437 printf(NAME ": devman_forward error - the device is not in "438 " usable state.\n", handle);437 printf(NAME ": devman_forward error - the device is not in %" PRIun 438 " usable state.\n", handle); 439 439 ipc_answer_0(iid, ENOENT); 440 440 return; … … 450 450 printf(NAME ": devman_forward: cound not forward to driver %s ", 451 451 driver->name); 452 printf("the driver's phone is % x).\n", driver->phone);452 printf("the driver's phone is %" PRIun ").\n", driver->phone); 453 453 ipc_answer_0(iid, EINVAL); 454 454 return; -
uspace/srv/devmap/devmap.c
r178673c rab3a851 555 555 if (devmap_device_find_name(namespace->name, device->name) != NULL) { 556 556 printf("%s: Device '%s/%s' already registered\n", NAME, 557 device->namespace , device->name);557 device->namespace->name, device->name); 558 558 devmap_namespace_destroy(namespace); 559 559 fibril_mutex_unlock(&devices_list_mutex); … … 1052 1052 break; 1053 1053 default: 1054 if (!(callid & IPC_CALLID_NOTIFICATION)) 1055 ipc_answer_0(callid, ENOENT); 1054 ipc_answer_0(callid, ENOENT); 1056 1055 } 1057 1056 } … … 1111 1110 break; 1112 1111 default: 1113 if (!(callid & IPC_CALLID_NOTIFICATION)) 1114 ipc_answer_0(callid, ENOENT); 1112 ipc_answer_0(callid, ENOENT); 1115 1113 } 1116 1114 } -
uspace/srv/hid/console/console.c
r178673c rab3a851 804 804 if (screenbuffer_init(&consoles[i].scr, 805 805 fb_info.cols, fb_info.rows) == NULL) { 806 printf(NAME ": Unable to allocate screen buffer % u\n", i);806 printf(NAME ": Unable to allocate screen buffer %zu\n", i); 807 807 return false; 808 808 } … … 813 813 814 814 char vc[DEVMAP_NAME_MAXLEN + 1]; 815 snprintf(vc, DEVMAP_NAME_MAXLEN, "%s/vc% u", NAMESPACE, i);815 snprintf(vc, DEVMAP_NAME_MAXLEN, "%s/vc%zu", NAMESPACE, i); 816 816 817 817 if (devmap_device_register(vc, &consoles[i].devmap_handle) != EOK) { -
uspace/srv/hid/console/gcons.c
r178673c rab3a851 157 157 158 158 char data[5]; 159 snprintf(data, 5, "% u", index + 1);159 snprintf(data, 5, "%zu", index + 1); 160 160 161 161 size_t i; -
uspace/srv/hid/fb/serial_console.c
r178673c rab3a851 47 47 #include <io/style.h> 48 48 #include <str.h> 49 #include <inttypes.h> 49 50 #include <io/screenbuffer.h> 50 51 … … 135 136 136 137 char control[MAX_CONTROL]; 137 snprintf(control, MAX_CONTROL, "\033[%u;%uf", row + 1, col + 1); 138 snprintf(control, MAX_CONTROL, "\033[%" PRIun ";%" PRIun "f", 139 row + 1, col + 1); 138 140 serial_puts(control); 139 141 } … … 253 255 { 254 256 char control[MAX_CONTROL]; 255 snprintf(control, MAX_CONTROL, "\033[0;% ur", last_row);257 snprintf(control, MAX_CONTROL, "\033[0;%" PRIun "r", last_row); 256 258 serial_puts(control); 257 259 } -
uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
r178673c rab3a851 50 50 #include <sysinfo.h> 51 51 #include <errno.h> 52 #include <inttypes.h> 52 53 53 54 #include "s3c24xx_ts.h" … … 136 137 ts->last_y = 0; 137 138 138 printf(NAME ": device at physical address 0x%x, inr %d.\n",139 ts->paddr, inr);139 printf(NAME ": device at physical address %p, inr %" PRIun ".\n", 140 (void *) ts->paddr, inr); 140 141 141 142 async_set_interrupt_received(s3c24xx_ts_irq_handler); -
uspace/srv/hw/char/i8042/i8042.c
r178673c rab3a851 46 46 #include <stdio.h> 47 47 #include <errno.h> 48 #include <inttypes.h> 48 49 49 50 #include "i8042.h" … … 201 202 ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd); 202 203 ipc_register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd); 203 printf("%s: registered for interrupts %d and %d\n", NAME, inr_a, inr_b); 204 printf("%s: registered for interrupts %" PRIun " and %" PRIun "\n", 205 NAME, inr_a, inr_b); 204 206 205 207 wait_ready(); … … 262 264 break; 263 265 case IPC_FIRST_USER_METHOD: 264 printf(NAME ": write % dto devid %d\n",266 printf(NAME ": write %" PRIun " to devid %d\n", 265 267 IPC_GET_ARG1(call), dev_id); 266 268 i8042_port_write(dev_id, IPC_GET_ARG1(call)); -
uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
r178673c rab3a851 48 48 #include <sysinfo.h> 49 49 #include <errno.h> 50 #include <inttypes.h> 50 51 51 52 #include "s3c24xx_uart.h" … … 95 96 if (rc != EOK) { 96 97 devmap_hangup_phone(DEVMAP_DRIVER); 97 printf(NAME ": Unable to register device %s.\n"); 98 printf(NAME ": Unable to register device %s.\n", 99 NAMESPACE "/" NAME); 98 100 return -1; 99 101 } … … 134 136 break; 135 137 case CHAR_WRITE_BYTE: 136 printf(NAME ": write % dto device\n",138 printf(NAME ": write %" PRIun " to device\n", 137 139 IPC_GET_ARG1(call)); 138 140 s3c24xx_uart_sendb(uart, (uint8_t) IPC_GET_ARG1(call)); … … 185 187 uart->client_phone = -1; 186 188 187 printf(NAME ": device at physical address 0x%x, inr %d.\n",188 uart->paddr, inr);189 printf(NAME ": device at physical address %p, inr %" PRIun ".\n", 190 (void *) uart->paddr, inr); 189 191 190 192 async_set_interrupt_received(s3c24xx_uart_irq_handler); -
uspace/srv/hw/cir/fhc/fhc.c
r178673c rab3a851 129 129 } 130 130 131 printf(NAME ": FHC UART registers at %p, % dbytes\n", fhc_uart_phys,131 printf(NAME ": FHC UART registers at %p, %zu bytes\n", fhc_uart_phys, 132 132 fhc_uart_size); 133 133 -
uspace/srv/hw/netif/dp8390/dp8390.c
r178673c rab3a851 1516 1516 if (!wdeth_probe(dep) && !ne_probe(dep) && !el2_probe(dep)) 1517 1517 { 1518 printf("%s: No ethernet card found at 0x%x\n",1519 1518 printf("%s: No ethernet card found at %#lx\n", 1519 dep->de_name, dep->de_base_port); 1520 1520 dep->de_mode= DEM_DISABLED; 1521 1521 return; -
uspace/srv/hw/netif/dp8390/ne2000.c
r178673c rab3a851 267 267 if (!debug) 268 268 { 269 printf("%s: NE%d000 at % X:%d\n",270 271 269 printf("%s: NE%d000 at %#lx:%d\n", 270 dep->de_name, dep->de_16bit ? 2 : 1, 271 dep->de_base_port, dep->de_irq); 272 272 } 273 273 else 274 274 { 275 275 printf("%s: Novell NE%d000 ethernet card at I/O address " 276 "0x%X, memory size 0x%X, irq %d\n",277 278 276 "%#lx, memory size %#lx, irq %d\n", 277 dep->de_name, dep->de_16bit ? 2 : 1, 278 dep->de_base_port, dep->de_ramsize, dep->de_irq); 279 279 } 280 280 } -
uspace/srv/loader/main.c
r178673c rab3a851 411 411 break; 412 412 } 413 if ((callid & IPC_CALLID_NOTIFICATION) == 0 && 414 IPC_GET_METHOD(call) != IPC_M_PHONE_HUNGUP) { 413 if (IPC_GET_METHOD(call) != IPC_M_PHONE_HUNGUP) { 415 414 DPRINTF("Responding EINVAL to method %d.\n", 416 415 IPC_GET_METHOD(call)); -
uspace/srv/net/il/arp/arp.c
r178673c rab3a851 391 391 device->packet_dimension.content = mtu; 392 392 fibril_rwlock_write_unlock(&arp_globals.lock); 393 printf("arp - device %d changed mtu to % d\n\n", device_id, mtu);393 printf("arp - device %d changed mtu to %zu\n\n", device_id, mtu); 394 394 return EOK; 395 395 } -
uspace/srv/net/il/ip/ip.c
r178673c rab3a851 461 461 462 462 if (ip_netif->packet_dimension.content < IP_MIN_CONTENT) { 463 printf("Maximum transmission unit % dbytes is too small, at "463 printf("Maximum transmission unit %zu bytes is too small, at " 464 464 "least %d bytes are needed\n", 465 465 ip_netif->packet_dimension.content, IP_MIN_CONTENT); … … 502 502 fibril_rwlock_write_unlock(&ip_globals.netifs_lock); 503 503 504 printf("%s: Device %d changed MTU to % d\n", NAME, device_id, mtu);504 printf("%s: Device %d changed MTU to %zu\n", NAME, device_id, mtu); 505 505 506 506 return EOK; -
uspace/srv/net/nil/eth/eth.c
r178673c rab3a851 315 315 device->mtu = ETH_MAX_TAGGED_CONTENT(device->flags); 316 316 317 printf("Device %d already exists:\tMTU\t= % d\n",317 printf("Device %d already exists:\tMTU\t= %zu\n", 318 318 device->device_id, device->mtu); 319 319 fibril_rwlock_write_unlock(ð_globals.devices_lock); … … 407 407 } 408 408 409 printf("%s: Device registered (id: %d, service: %d: mtu: % d, "409 printf("%s: Device registered (id: %d, service: %d: mtu: %zu, " 410 410 "mac: %x:%x:%x:%x:%x:%x, flags: 0x%x)\n", 411 411 NAME, device->device_id, device->service, device->mtu, -
uspace/srv/net/nil/nildummy/nildummy.c
r178673c rab3a851 175 175 device->mtu = NET_DEFAULT_MTU; 176 176 177 printf("Device %d already exists:\tMTU\t= % d\n",177 printf("Device %d already exists:\tMTU\t= %zu\n", 178 178 device->device_id, device->mtu); 179 179 fibril_rwlock_write_unlock(&nildummy_globals.devices_lock); … … 232 232 } 233 233 234 printf("%s: Device registered (id: %d, service: %d, mtu: % d)\n",234 printf("%s: Device registered (id: %d, service: %d, mtu: %zu)\n", 235 235 NAME, device->device_id, device->service, device->mtu); 236 236 fibril_rwlock_write_unlock(&nildummy_globals.devices_lock); -
uspace/srv/ns/task.c
r178673c rab3a851 262 262 if (ht == NULL) { 263 263 /* No such task exists. */ 264 retval = ENOENT;265 goto out;264 ipc_answer_0(callid, ENOENT); 265 return; 266 266 } 267 267 -
uspace/srv/taskmon/taskmon.c
r178673c rab3a851 60 60 thread = IPC_GET_ARG3(*call); 61 61 62 if (asprintf(&s_taskid, "%" PRIu TASKID, taskid) < 0) {62 if (asprintf(&s_taskid, "%" PRIu64, taskid) < 0) { 63 63 printf("Memory allocation failed.\n"); 64 64 return; 65 65 } 66 66 67 printf(NAME ": Task %" PRIuTASKID " fault in thread %p.\n", taskid, thread); 67 printf(NAME ": Task %" PRIu64 " fault in thread %p.\n", taskid, 68 (void *) thread); 68 69 69 70 fname = "/app/taskdump"; … … 72 73 char *dump_fname; 73 74 74 if (asprintf(&dump_fname, "/data/core%" PRIu TASKID, taskid) < 0) {75 if (asprintf(&dump_fname, "/data/core%" PRIu64, taskid) < 0) { 75 76 printf("Memory allocation failed.\n"); 76 77 return; 77 78 } 78 79 79 printf(NAME ": Executing %s -c %s -t %s\n", dump_fname, s_taskid);80 printf(NAME ": Executing %s -c %s -t %s\n", fname, dump_fname, s_taskid); 80 81 rc = task_spawnl(NULL, fname, fname, "-c", dump_fname, "-t", s_taskid, 81 82 NULL); 82 83 #else 83 printf(NAME ": Executing %s -t %s\n", s_taskid);84 printf(NAME ": Executing %s -t %s\n", fname, s_taskid); 84 85 rc = task_spawnl(NULL, fname, fname, "-t", s_taskid, NULL); 85 86 #endif -
uspace/srv/vfs/vfs_ops.c
r178673c rab3a851 55 55 56 56 /* Forward declarations of static functions. */ 57 static int vfs_truncate_internal(fs_handle_t, devmap_handle_t, fs_index_t, aoff64_t); 57 static int vfs_truncate_internal(fs_handle_t, devmap_handle_t, fs_index_t, 58 aoff64_t); 58 59 59 60 /** … … 250 251 void vfs_mount(ipc_callid_t rid, ipc_call_t *request) 251 252 { 253 devmap_handle_t devmap_handle; 254 252 255 /* 253 256 * We expect the library to do the device-name to device-handle … … 255 258 * in the request. 256 259 */ 257 devmap_handle _t devmap_handle= (devmap_handle_t) IPC_GET_ARG1(*request);260 devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request); 258 261 259 262 /* … … 291 294 */ 292 295 char *fs_name; 293 rc = async_data_write_accept((void **) &fs_name, true, 0, FS_NAME_MAXLEN,294 0, NULL);296 rc = async_data_write_accept((void **) &fs_name, true, 0, 297 FS_NAME_MAXLEN, 0, NULL); 295 298 if (rc != EOK) { 296 299 free(mp); … … 458 461 459 462 phone = vfs_grab_phone(mp_node->fs_handle); 460 rc = async_req_2_0(phone, VFS_OUT_UNMOUNT, mp_node->devmap_handle,461 mp_node-> index);463 rc = async_req_2_0(phone, VFS_OUT_UNMOUNT, 464 mp_node->devmap_handle, mp_node->index); 462 465 vfs_release_phone(mp_node->fs_handle, phone); 463 466 if (rc != EOK) { … … 740 743 aid_t msg; 741 744 ipc_call_t answer; 742 msg = async_send_2(fs_phone, VFS_OUT_CLOSE, file->node->devmap_handle,743 file->node-> index, &answer);745 msg = async_send_2(fs_phone, VFS_OUT_CLOSE, 746 file->node->devmap_handle, file->node->index, &answer); 744 747 745 748 /* Wait for reply from the FS server. */ … … 834 837 ipc_call_t answer; 835 838 if (read) { 836 if (file->append)837 file->pos = file->node->size;838 839 839 rc = async_data_read_forward_3_1(fs_phone, VFS_OUT_READ, 840 840 file->node->devmap_handle, file->node->index, file->pos, 841 841 &answer); 842 842 } else { 843 if (file->append) 844 file->pos = file->node->size; 845 843 846 rc = async_data_write_forward_3_1(fs_phone, VFS_OUT_WRITE, 844 847 file->node->devmap_handle, file->node->index, file->pos, … … 888 891 { 889 892 int fd = (int) IPC_GET_ARG1(*request); 890 off64_t off = 891 (off64_t) MERGE_LOUP32(IPC_GET_ARG2(*request),IPC_GET_ARG3(*request));893 off64_t off = (off64_t) MERGE_LOUP32(IPC_GET_ARG2(*request), 894 IPC_GET_ARG3(*request)); 892 895 int whence = (int) IPC_GET_ARG4(*request); 893 896 … … 903 906 off64_t newoff; 904 907 switch (whence) { 905 case SEEK_SET: 906 if (off >= 0) { 907 file->pos = (aoff64_t) off; 908 fibril_mutex_unlock(&file->lock); 909 ipc_answer_1(rid, EOK, off); 910 return; 911 } 912 break; 913 case SEEK_CUR: 914 if ((off >= 0) && (file->pos + off < file->pos)) { 915 fibril_mutex_unlock(&file->lock); 916 ipc_answer_0(rid, EOVERFLOW); 917 return; 918 } 919 920 if ((off < 0) && (file->pos < (aoff64_t) -off)) { 921 fibril_mutex_unlock(&file->lock); 922 ipc_answer_0(rid, EOVERFLOW); 923 return; 924 } 925 926 file->pos += off; 927 newoff = (file->pos > OFF64_MAX) ? OFF64_MAX : file->pos; 928 908 case SEEK_SET: 909 if (off >= 0) { 910 file->pos = (aoff64_t) off; 929 911 fibril_mutex_unlock(&file->lock); 930 ipc_answer_2(rid, EOK, LOWER32(newoff), UPPER32(newoff)); 931 return; 932 case SEEK_END: 933 fibril_rwlock_read_lock(&file->node->contents_rwlock); 934 aoff64_t size = file->node->size; 935 936 if ((off >= 0) && (size + off < size)) { 937 fibril_rwlock_read_unlock(&file->node->contents_rwlock); 938 fibril_mutex_unlock(&file->lock); 939 ipc_answer_0(rid, EOVERFLOW); 940 return; 941 } 942 943 if ((off < 0) && (size < (aoff64_t) -off)) { 944 fibril_rwlock_read_unlock(&file->node->contents_rwlock); 945 fibril_mutex_unlock(&file->lock); 946 ipc_answer_0(rid, EOVERFLOW); 947 return; 948 } 949 950 file->pos = size + off; 951 newoff = (file->pos > OFF64_MAX) ? OFF64_MAX : file->pos; 952 912 ipc_answer_1(rid, EOK, off); 913 return; 914 } 915 break; 916 case SEEK_CUR: 917 if ((off >= 0) && (file->pos + off < file->pos)) { 918 fibril_mutex_unlock(&file->lock); 919 ipc_answer_0(rid, EOVERFLOW); 920 return; 921 } 922 923 if ((off < 0) && (file->pos < (aoff64_t) -off)) { 924 fibril_mutex_unlock(&file->lock); 925 ipc_answer_0(rid, EOVERFLOW); 926 return; 927 } 928 929 file->pos += off; 930 newoff = (file->pos > OFF64_MAX) ? OFF64_MAX : file->pos; 931 932 fibril_mutex_unlock(&file->lock); 933 ipc_answer_2(rid, EOK, LOWER32(newoff), 934 UPPER32(newoff)); 935 return; 936 case SEEK_END: 937 fibril_rwlock_read_lock(&file->node->contents_rwlock); 938 aoff64_t size = file->node->size; 939 940 if ((off >= 0) && (size + off < size)) { 953 941 fibril_rwlock_read_unlock(&file->node->contents_rwlock); 954 942 fibril_mutex_unlock(&file->lock); 955 ipc_answer_2(rid, EOK, LOWER32(newoff), UPPER32(newoff)); 956 return; 943 ipc_answer_0(rid, EOVERFLOW); 944 return; 945 } 946 947 if ((off < 0) && (size < (aoff64_t) -off)) { 948 fibril_rwlock_read_unlock(&file->node->contents_rwlock); 949 fibril_mutex_unlock(&file->lock); 950 ipc_answer_0(rid, EOVERFLOW); 951 return; 952 } 953 954 file->pos = size + off; 955 newoff = (file->pos > OFF64_MAX) ? OFF64_MAX : file->pos; 956 957 fibril_rwlock_read_unlock(&file->node->contents_rwlock); 958 fibril_mutex_unlock(&file->lock); 959 ipc_answer_2(rid, EOK, LOWER32(newoff), UPPER32(newoff)); 960 return; 957 961 } 958 962 … … 977 981 { 978 982 int fd = IPC_GET_ARG1(*request); 979 aoff64_t size = 980 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(*request),IPC_GET_ARG3(*request));983 aoff64_t size = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG2(*request), 984 IPC_GET_ARG3(*request)); 981 985 int rc; 982 986
Note:
See TracChangeset
for help on using the changeset viewer.