Changeset f0950d2 in mainline for uspace/srv/bd/hr/util.c
- Timestamp:
- 2025-06-17T13:23:57Z (7 months ago)
- Children:
- d574c11
- Parents:
- 234212a
- File:
-
- 1 edited
-
uspace/srv/bd/hr/util.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/util.c
r234212a rf0950d2 76 76 extern fibril_rwlock_t hr_volumes_lock; 77 77 78 /* 79 * malloc() wrapper that behaves like 80 * FreeBSD malloc(9) with M_WAITOK flag. 81 * 82 * Return value is never NULL. 83 */ 84 void *malloc_waitok(size_t size) 85 { 86 void *ret; 87 while ((ret = malloc(size)) == NULL) 88 fibril_usleep(MSEC2USEC(250)); /* sleep 250ms */ 89 90 return ret; 91 } 92 93 void *calloc_waitok(size_t nmemb, size_t size) 94 { 95 void *ret; 96 while ((ret = calloc(nmemb, size)) == NULL) 97 fibril_usleep(MSEC2USEC(250)); /* sleep 250ms */ 98 99 return ret; 100 } 101 78 102 errno_t hr_create_vol_struct(hr_volume_t **rvol, hr_level_t level, 79 103 const char *devname, hr_metadata_type_t metadata_type)
Note:
See TracChangeset
for help on using the changeset viewer.
