Changeset 34120f10 in mainline for uspace/lib/c
- Timestamp:
- 2023-10-27T19:38:31Z (21 months ago)
- Branches:
- master, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63ed840
- Parents:
- c89ae25 (diff), 694ca3d6 (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/lib/c
- Files:
-
- 1 added
- 3 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/asprintf.c
rc89ae25 r34120f10 39 39 #include <stddef.h> 40 40 #include <str.h> 41 #include < io/printf_core.h>41 #include <printf_core.h> 42 42 43 43 static int asprintf_str_write(const char *str, size_t count, void *unused) -
uspace/lib/c/generic/io/kio.c
rc89ae25 r34120f10 42 42 #include <abi/kio.h> 43 43 #include <io/kio.h> 44 #include < io/printf_core.h>44 #include <printf_core.h> 45 45 #include <macros.h> 46 46 #include <libarch/config.h> -
uspace/lib/c/generic/io/printf.c
rc89ae25 r34120f10 33 33 */ 34 34 35 #include < io/printf_core.h>35 #include <printf_core.h> 36 36 #include <stdio.h> 37 37 -
uspace/lib/c/generic/io/vprintf.c
rc89ae25 r34120f10 35 35 #include <stdarg.h> 36 36 #include <stdio.h> 37 #include < io/printf_core.h>37 #include <printf_core.h> 38 38 #include <fibril_synch.h> 39 39 #include <async.h> -
uspace/lib/c/generic/io/vsnprintf.c
rc89ae25 r34120f10 36 36 #include <stdio.h> 37 37 #include <str.h> 38 #include < io/printf_core.h>38 #include <printf_core.h> 39 39 #include <errno.h> 40 40 -
uspace/lib/c/generic/malloc.c
rc89ae25 r34120f10 34 34 */ 35 35 36 #include < malloc.h>36 #include <stdlib.h> 37 37 #include <stdalign.h> 38 38 #include <stdbool.h> … … 47 47 #include <stdlib.h> 48 48 #include <adt/gcdlcm.h> 49 #include <malloc.h> 49 50 50 51 #include "private/malloc.h" … … 773 774 } 774 775 775 /** Allocate memory by number of elements776 *777 * @param nmemb Number of members to allocate.778 * @param size Size of one member in bytes.779 *780 * @return Allocated memory or NULL.781 *782 */783 void *calloc(const size_t nmemb, const size_t size)784 {785 // FIXME: Check for overflow786 787 void *block = malloc(nmemb * size);788 if (block == NULL)789 return NULL;790 791 memset(block, 0, nmemb * size);792 return block;793 }794 795 776 /** Allocate memory 796 777 * -
uspace/lib/c/include/malloc.h
rc89ae25 r34120f10 39 39 #include <_bits/decls.h> 40 40 41 __C_DECLS_BEGIN;42 43 extern void *malloc(size_t size)44 __attribute__((malloc));45 extern void *calloc(size_t nmemb, size_t size)46 __attribute__((malloc));47 extern void *realloc(void *addr, size_t size)48 __attribute__((warn_unused_result));49 extern void free(void *addr);50 51 __C_DECLS_END;52 53 41 #ifdef _HELENOS_SOURCE 54 42 __HELENOS_DECLS_BEGIN; 55 43 56 extern void *memalign(size_t align, size_t size)57 __attribute__((malloc));58 44 extern void *heap_check(void); 59 45 -
uspace/lib/c/meson.build
rc89ae25 r34120f10 42 42 root_path / 'abi' / 'arch' / UARCH / 'include', 43 43 root_path / 'abi' / 'include', 44 root_path / 'common' / 'include', 44 45 ] 45 46 … … 60 61 61 62 src += files( 63 'common/adt/checksum.c', 64 'common/adt/circ_buf.c', 65 'common/adt/list.c', 66 'common/adt/hash_table.c', 67 'common/adt/odict.c', 68 'common/adt/prodcons.c', 69 'common/printf/printf_core.c', 70 'common/stdc/ctype.c', 71 'common/stdc/mem.c', 72 'common/stdc/bsearch.c', 73 'common/stdc/qsort.c', 74 'common/stdc/calloc.c', 75 'common/gsort.c', 76 'common/str.c', 77 'common/str_error.c', 78 'common/strtol.c', 79 62 80 'generic/libc.c', 63 81 'generic/as.c', … … 69 87 'generic/context.c', 70 88 'generic/corecfg.c', 71 'generic/ctype.c',72 89 'generic/device/clock_dev.c', 73 90 'generic/device/hw_res.c', … … 81 98 'generic/event.c', 82 99 'generic/errno.c', 83 'generic/gsort.c',84 100 'generic/inttypes.c', 85 101 'generic/ipc_test.c', 86 102 'generic/loc.c', 87 'generic/mem.c',88 'generic/str.c',89 103 'generic/string.c', 90 'generic/str_error.c',91 'generic/strtol.c',92 104 'generic/l18n/langs.c', 93 105 'generic/pcb.c', … … 109 121 'generic/io/vprintf.c', 110 122 'generic/io/vsnprintf.c', 111 'generic/io/printf_core.c',112 123 'generic/io/con_srv.c', 113 124 'generic/io/console.c', … … 138 149 'generic/loader.c', 139 150 'generic/getopt.c', 140 'generic/adt/checksum.c',141 'generic/adt/circ_buf.c',142 'generic/adt/list.c',143 'generic/adt/hash_table.c',144 'generic/adt/odict.c',145 'generic/adt/prodcons.c',146 151 'generic/time.c', 147 152 'generic/tmpfile.c', … … 159 164 'generic/stats.c', 160 165 'generic/assert.c', 161 'generic/bsearch.c',162 'generic/qsort.c',163 166 'generic/ubsan.c', 164 167 'generic/uuid.c',
Note:
See TracChangeset
for help on using the changeset viewer.