Changes in uspace/lib/c/generic/loc.c [b7fd2a0:38d150e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/loc.c
rb7fd2a0 r38d150e 103 103 * 104 104 */ 105 static errno_t loc_callback_create(void)105 static int loc_callback_create(void) 106 106 { 107 107 if (!loc_callback_created) { … … 113 113 114 114 port_id_t port; 115 errno_t rc = async_create_callback_port(exch, INTERFACE_LOC_CB, 0, 0,115 int rc = async_create_callback_port(exch, INTERFACE_LOC_CB, 0, 0, 116 116 loc_cb_conn, NULL, &port); 117 117 … … 121 121 return rc; 122 122 123 errno_t retval;123 sysarg_t retval; 124 124 async_wait_for(req, &retval); 125 125 if (retval != EOK) … … 239 239 240 240 /** Register new driver with loc. */ 241 errno_t loc_server_register(const char *name)241 int loc_server_register(const char *name) 242 242 { 243 243 async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_SUPPLIER); … … 245 245 ipc_call_t answer; 246 246 aid_t req = async_send_2(exch, LOC_SERVER_REGISTER, 0, 0, &answer); 247 errno_t retval = async_data_write_start(exch, name, str_size(name));247 sysarg_t retval = async_data_write_start(exch, name, str_size(name)); 248 248 249 249 if (retval != EOK) { … … 272 272 * 273 273 */ 274 errno_t loc_service_register(const char *fqsn, service_id_t *sid)274 int loc_service_register(const char *fqsn, service_id_t *sid) 275 275 { 276 276 async_exch_t *exch = loc_exchange_begin_blocking(INTERFACE_LOC_SUPPLIER); … … 278 278 ipc_call_t answer; 279 279 aid_t req = async_send_0(exch, LOC_SERVICE_REGISTER, &answer); 280 errno_t retval = async_data_write_start(exch, fqsn, str_size(fqsn));280 sysarg_t retval = async_data_write_start(exch, fqsn, str_size(fqsn)); 281 281 282 282 if (retval != EOK) { … … 311 311 * @param sid Service ID 312 312 */ 313 errno_t loc_service_unregister(service_id_t sid)313 int loc_service_unregister(service_id_t sid) 314 314 { 315 315 async_exch_t *exch; 316 errno_t retval;316 sysarg_t retval; 317 317 318 318 exch = loc_exchange_begin_blocking(INTERFACE_LOC_SUPPLIER); … … 320 320 loc_exchange_end(exch); 321 321 322 return ( errno_t)retval;323 } 324 325 errno_t loc_service_get_id(const char *fqdn, service_id_t *handle,322 return (int)retval; 323 } 324 325 int loc_service_get_id(const char *fqdn, service_id_t *handle, 326 326 unsigned int flags) 327 327 { … … 339 339 aid_t req = async_send_2(exch, LOC_SERVICE_GET_ID, flags, 0, 340 340 &answer); 341 errno_t retval = async_data_write_start(exch, fqdn, str_size(fqdn));341 sysarg_t retval = async_data_write_start(exch, fqdn, str_size(fqdn)); 342 342 343 343 loc_exchange_end(exch); … … 371 371 * @param name Place to store pointer to new string. Caller should 372 372 * free it using free(). 373 * @return EOK on success or anerror code374 */ 375 static errno_t loc_get_name_internal(sysarg_t method, sysarg_t id, char **name)373 * @return EOK on success or negative error code 374 */ 375 static int loc_get_name_internal(sysarg_t method, sysarg_t id, char **name) 376 376 { 377 377 async_exch_t *exch; … … 379 379 ipc_call_t dreply; 380 380 size_t act_size; 381 errno_t dretval;381 sysarg_t dretval; 382 382 383 383 *name = NULL; … … 397 397 } 398 398 399 errno_t retval;399 sysarg_t retval; 400 400 async_wait_for(req, &retval); 401 401 … … 421 421 * @param name Place to store pointer to new string. Caller should 422 422 * free it using free(). 423 * @return EOK on success or anerror code424 */ 425 errno_t loc_category_get_name(category_id_t cat_id, char **name)423 * @return EOK on success or negative error code 424 */ 425 int loc_category_get_name(category_id_t cat_id, char **name) 426 426 { 427 427 return loc_get_name_internal(LOC_CATEGORY_GET_NAME, cat_id, name); … … 435 435 * @param name Place to store pointer to new string. Caller should 436 436 * free it using free(). 437 * @return EOK on success or anerror code438 */ 439 errno_t loc_service_get_name(service_id_t svc_id, char **name)437 * @return EOK on success or negative error code 438 */ 439 int loc_service_get_name(service_id_t svc_id, char **name) 440 440 { 441 441 return loc_get_name_internal(LOC_SERVICE_GET_NAME, svc_id, name); … … 449 449 * @param name Place to store pointer to new string. Caller should 450 450 * free it using free(). 451 * @return EOK on success or anerror code452 */ 453 errno_t loc_service_get_server_name(service_id_t svc_id, char **name)451 * @return EOK on success or negative error code 452 */ 453 int loc_service_get_server_name(service_id_t svc_id, char **name) 454 454 { 455 455 return loc_get_name_internal(LOC_SERVICE_GET_SERVER_NAME, svc_id, name); 456 456 } 457 457 458 errno_t loc_namespace_get_id(const char *name, service_id_t *handle,458 int loc_namespace_get_id(const char *name, service_id_t *handle, 459 459 unsigned int flags) 460 460 { … … 472 472 aid_t req = async_send_2(exch, LOC_NAMESPACE_GET_ID, flags, 0, 473 473 &answer); 474 errno_t retval = async_data_write_start(exch, name, str_size(name));474 sysarg_t retval = async_data_write_start(exch, name, str_size(name)); 475 475 476 476 loc_exchange_end(exch); … … 503 503 * @param cat_id Place to store ID 504 504 * @param flags IPC_FLAG_BLOCKING to wait for location service to start 505 * @return EOK on success or anerror code506 */ 507 errno_t loc_category_get_id(const char *name, category_id_t *cat_id,505 * @return EOK on success or negative error code 506 */ 507 int loc_category_get_id(const char *name, category_id_t *cat_id, 508 508 unsigned int flags) 509 509 { … … 521 521 aid_t req = async_send_0(exch, LOC_CATEGORY_GET_ID, 522 522 &answer); 523 errno_t retval = async_data_write_start(exch, name, str_size(name));523 sysarg_t retval = async_data_write_start(exch, name, str_size(name)); 524 524 525 525 loc_exchange_end(exch); … … 551 551 552 552 sysarg_t type; 553 errno_t retval = async_req_1_1(exch, LOC_ID_PROBE, handle, &type);553 int retval = async_req_1_1(exch, LOC_ID_PROBE, handle, &type); 554 554 555 555 loc_exchange_end(exch); … … 574 574 } 575 575 576 /**577 * @return ID of a new NULL device, or -1 if failed.578 */579 576 int loc_null_create(void) 580 577 { … … 582 579 583 580 sysarg_t null_id; 584 errno_t retval = async_req_0_1(exch, LOC_NULL_CREATE, &null_id);581 int retval = async_req_0_1(exch, LOC_NULL_CREATE, &null_id); 585 582 586 583 loc_exchange_end(exch); … … 602 599 { 603 600 sysarg_t count; 604 errno_t retval = async_req_0_1(exch, LOC_GET_NAMESPACE_COUNT, &count);601 int retval = async_req_0_1(exch, LOC_GET_NAMESPACE_COUNT, &count); 605 602 if (retval != EOK) 606 603 return 0; … … 613 610 * @param svc_id Service ID 614 611 * @param cat_id Category ID 615 * @return EOK on success or anerror code616 */ 617 errno_t loc_service_add_to_cat(service_id_t svc_id, service_id_t cat_id)612 * @return EOK on success or negative error code 613 */ 614 int loc_service_add_to_cat(service_id_t svc_id, service_id_t cat_id) 618 615 { 619 616 async_exch_t *exch; 620 errno_t retval;617 sysarg_t retval; 621 618 622 619 exch = loc_exchange_begin_blocking(INTERFACE_LOC_SUPPLIER); … … 631 628 { 632 629 sysarg_t count; 633 errno_t retval = async_req_1_1(exch, LOC_GET_SERVICE_COUNT, ns_handle,630 int retval = async_req_1_1(exch, LOC_GET_SERVICE_COUNT, ns_handle, 634 631 &count); 635 632 if (retval != EOK) … … 676 673 ipc_call_t answer; 677 674 aid_t req = async_send_0(exch, LOC_GET_NAMESPACES, &answer); 678 errno_t rc = async_data_read_start(exch, devs, count * sizeof(loc_sdesc_t));675 int rc = async_data_read_start(exch, devs, count * sizeof(loc_sdesc_t)); 679 676 680 677 loc_exchange_end(exch); … … 695 692 } 696 693 697 errno_t retval;694 sysarg_t retval; 698 695 async_wait_for(req, &retval); 699 696 … … 725 722 ipc_call_t answer; 726 723 aid_t req = async_send_1(exch, LOC_GET_SERVICES, ns_handle, &answer); 727 errno_t rc = async_data_read_start(exch, devs, count * sizeof(loc_sdesc_t));724 int rc = async_data_read_start(exch, devs, count * sizeof(loc_sdesc_t)); 728 725 729 726 loc_exchange_end(exch); … … 744 741 } 745 742 746 errno_t retval;743 sysarg_t retval; 747 744 async_wait_for(req, &retval); 748 745 … … 755 752 } 756 753 757 static errno_t loc_category_get_ids_once(sysarg_t method, sysarg_t arg1,754 static int loc_category_get_ids_once(sysarg_t method, sysarg_t arg1, 758 755 sysarg_t *id_buf, size_t buf_size, size_t *act_size) 759 756 { … … 762 759 ipc_call_t answer; 763 760 aid_t req = async_send_1(exch, method, arg1, &answer); 764 errno_t rc = async_data_read_start(exch, id_buf, buf_size);761 int rc = async_data_read_start(exch, id_buf, buf_size); 765 762 766 763 loc_exchange_end(exch); … … 771 768 } 772 769 773 errno_t retval;770 sysarg_t retval; 774 771 async_wait_for(req, &retval); 775 772 … … 790 787 * @param data Place to store pointer to array of IDs 791 788 * @param count Place to store number of IDs 792 * @return EOK on success or anerror code793 */ 794 static errno_t loc_get_ids_internal(sysarg_t method, sysarg_t arg1,789 * @return EOK on success or negative error code 790 */ 791 static int loc_get_ids_internal(sysarg_t method, sysarg_t arg1, 795 792 sysarg_t **data, size_t *count) 796 793 { … … 799 796 800 797 size_t act_size = 0; 801 errno_t rc = loc_category_get_ids_once(method, arg1, NULL, 0,798 int rc = loc_category_get_ids_once(method, arg1, NULL, 0, 802 799 &act_size); 803 800 if (rc != EOK) … … 836 833 * @param data Place to store pointer to array of IDs 837 834 * @param count Place to store number of IDs 838 * @return EOK on success or anerror code839 */ 840 errno_t loc_category_get_svcs(category_id_t cat_id, service_id_t **data,835 * @return EOK on success or negative error code 836 */ 837 int loc_category_get_svcs(category_id_t cat_id, service_id_t **data, 841 838 size_t *count) 842 839 { … … 851 848 * @param data Place to store pointer to array of IDs 852 849 * @param count Place to store number of IDs 853 * @return EOK on success or anerror code854 */ 855 errno_t loc_get_categories(category_id_t **data, size_t *count)850 * @return EOK on success or negative error code 851 */ 852 int loc_get_categories(category_id_t **data, size_t *count) 856 853 { 857 854 return loc_get_ids_internal(LOC_GET_CATEGORIES, 0, … … 859 856 } 860 857 861 errno_t loc_register_cat_change_cb(loc_cat_change_cb_t cb_fun)858 int loc_register_cat_change_cb(loc_cat_change_cb_t cb_fun) 862 859 { 863 860 fibril_mutex_lock(&loc_callback_mutex);
Note:
See TracChangeset
for help on using the changeset viewer.