From owner-freebsd-questions@freebsd.org Tue Jan 15 11:03:48 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1E6B14857F5 for ; Tue, 15 Jan 2019 11:03:47 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC80C82208 for ; Tue, 15 Jan 2019 11:03:46 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([92.193.226.69]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPA (Nemesis) id 1N0nvJ-1hUICq2JRF-00wjsw; Tue, 15 Jan 2019 11:58:25 +0100 Date: Tue, 15 Jan 2019 11:58:25 +0100 From: Polytropon To: iam@sdf.org Cc: freebsd-questions@freebsd.org Subject: Re: what is libc? Message-Id: <20190115115825.a040ceca.freebsd@edvax.de> In-Reply-To: <201901151033.x0FAXCeg027256@sdf.org> References: <201901151033.x0FAXCeg027256@sdf.org> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:Xc16AUkH4BkAzunMdGgS1//BUReCRBn9td0rkA7C5PAZdAU+mh9 u0djM4F5R09rpiL4vjeW+OyxbZj3ammac+1VK87aJkrDY5fJWD6lVpy8oRjCOIEqSskc+Eg EHYrj1sfUSGNzZb8P9Ml9oIoSeNmBUdVUD4V8FsVtU9xPYlEInf5cBlZ+c8vugSFIgPSFOr n3HSXyUD0es8vz9fFqLQQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:sHm6aTp95Tw=:NgggW+ThHCk76rC9F00Bw9 jJARZvROJPLqRBPc6FhrIfFbKc4E5LQ0D0mib1hvRoI2WT6TLn8Ta137AvPew+uH0SCxY+4G2 bAbSPDZLRYgZ0gRRQuf7I0PUnTkGE6Y2XoHTUgZsxsd3PctfQOlQIbl5Dofg6XX6vOewjlsFZ R/2/mZBxCiP5zMXjeG5soq/lP46m4x5Ow/HRn+eexl2i9/JSe/0x3oQRDi9UGeUNQO7wyU/HO WBEXxcIYXy2I58q9MIfNhT3Czs0M2KrQXzIfzof816kvnaEck+DsE/raijspX5wcxIueyYzc4 mz57JEyvcKRZZfNm4UbtAJUSdXtBpPSEOTekFGjbiVRWM2e6IQMB0Xf1nPKrfrLlo5R2qAY/e LiHca07Qqt9x5NtmDWTUJyXcrXCCiT1/Oq2ZM6AV9XGkgS+TlavO1BsxugyeRvnEWXdvajA/w yvVFyRmVkqH4U/ltiirmC5d2UFsaZihHiY8RpPFntsRtJBMf1gqvnOUSdNr8Qe6TGtV3JlMcC GU02zFT0Xm0PBEnmTgEOu18cQsk9OTI/pwNJ8vfB7VJasP/YkwfiiiDDwxiwS8jY2R24MN3xH ACMdjuJKHOyNJo8esewNzTLsvCbPiyaVdqUEulg29hU2FEiT2L0Qanr+3xri3Hqiv9SQGT0km w8fuM9kNYzav9LhgltKCE4CjIyvYKTy3QgizryqnAboL2jXNz89fwvNBwSBwVjTDTBGrhhmL8 USO7+oAziTrYJRMd8+K9sqsAbhSuIXmOD0OQK7oazpWEtsyjdmg3hnmQixQ= X-Rspamd-Queue-Id: AC80C82208 X-Spamd-Bar: ++++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [6.26 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; MV_CASE(0.50)[]; IP_SCORE(0.22)[ip: (1.04), ipnet: 212.227.0.0/16(-0.61), asn: 8560(0.66), country: DE(-0.01)]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; MX_GOOD(-0.01)[cached: mx01.schlund.de]; RCPT_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_PBL(0.00)[69.226.193.92.zen.spamhaus.org : 127.0.0.10]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.73)[0.734,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.92)[0.923,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[0.999,0]; RCVD_IN_DNSWL_NONE(0.00)[131.126.227.212.list.dnswl.org : 127.0.5.0]; MID_CONTAINS_FROM(1.00)[]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[] X-Spam: Yes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2019 11:03:48 -0000 On Tue, 15 Jan 2019 10:33:12 GMT, iam@sdf.org wrote: > what is libc exactly? is it the only interface between userland > and the kernel? or does libc do something more? if yes, may i know > what other functions does libc perform? The libc, "C standard library", is the system's default C library. It provides "wrappers" for kernel calls as well as extended functions specified by the C standard. It serves as the common programming interface for application development. Among the "wrappers", it also contains standardized (!) functions for string handling, error reporting, signal handling, or tools to deal with date and time. The behaviour of those functions is specified by the C language standard, which makes it a portable thing. > also, if suppose the userland were to be written in say "rust", > would it theoretically be possible to write libc in "rust", and > then would it have to be called "librust"? That is probably possible. A "Rust standard library", if it wanted to mimic what libc provides, would have to implement the content and functionality of libc in Rust, providing the appropriate interfaces for that particular language. > if libc isn't only about "c", why isn't it called libsys? Because it contains what the _C_ language standard specifies. However, you _can_ interface it from a different language and call its functions, but that doesn't change the fact of its nature and heritage. :-) > would > appreciate pointers to material to read to understand the above > in more depth than is possible via email. You can find a general description here: https://en.wikipedia.org/wiki/C_standard_library https://en.wikibooks.org/wiki/C_Programming/Standard_libraries -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...