From owner-freebsd-questions@freebsd.org Wed Jan 16 10:44:30 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 46F16148365F for ; Wed, 16 Jan 2019 10:44:30 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (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 374D596689 for ; Wed, 16 Jan 2019 10:44:28 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([92.193.226.69]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPA (Nemesis) id 1N2lv2-1hOeRc31CO-0137GW; Wed, 16 Jan 2019 11:39:08 +0100 Date: Wed, 16 Jan 2019 11:39:08 +0100 From: Polytropon To: Lorenzo Salvadore Cc: Lorenzo Salvadore via freebsd-questions Subject: Re: libc : non-c specific functions! Message-Id: <20190116113908.2dd84e96.freebsd@edvax.de> In-Reply-To: References: <201901160505.x0G558X1004475@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:fqbOSd1VybRK88jwD3Yq78+EmhKvEpwAnyhFoRekd8LBwUMYxhj FTOLhJ5/NvRpuHdQy51P+cE8MFJCLFkclGRtUzsok/in5atJwpSb3CSdev6BQRYDkAO5p1G Ai++gsv6OvmFHCNXRDFKtlulsUfkDSuoBV7ymURsvtk/HIausKWswg+l1jJgdi59m7JGGFD BCJX3S7frB9toR6Fn+0og== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:t1oyKMaJECI=:sKwqI/zXISQzf0ign2mglN aPhaYSqly6SQSdZfpiER8rxWl7VktnipTG1dcoNkCA0xPgIwAXnTVQlPuVWLNhuPZzUEhLs/3 i/BFlqIks7nZ7kuKAEzfUkMbymPMOSIzwCf4ARAfnx3R0me3mCDUhdmU5uIgkbvVrupj+Fadh jE/gPK7q61Xh+LfNhUeycTToNPTW5RWVoW2kEmzVNrGyhp7DXFxHNG2T/Y/tc83GFMfvmp7hl EQYfgJPTh/jMmFEnmUrCZp+p+ZSHpIcH2gntIeJkgotVWg2O3atHoN7mhrrvmV/MOoOaFG9Ct rJ3u5+MY7WPA7r+UMXTyYiILiW6fRX3/jrNZUPAaTbFCnAU7EA++pEIdZw0pp5iiyz2NrGEGF v2NVfJQNnjO2zVRXgTbPRkOuga7b93vqg9SgtZRNGySWgqGyoyu1NVwyHhU8+sWiXrlo3XJcX +AHZJbODWRwiDTT7w+I43dg5WgWfdw56HK5eFXnBQt/JQ6sPm8WN3fotukJb/Gmyg3htgV50t awsBk4dGl7pjwneMm2CMYquhYuNWI5nFuBarXdmJEkgtYaXVfPU/Lh3tW1per0d1N/jAY31pm b8g9NhphRZgHDKJ7daQHgrzgsZtQh2+Ev2RRabZlpazoAqLBRMnDZyJ6NwX/P+aGyNo8w+41X oPnqQwLCIfqZLVOsLNiacASaXxcfhN2pOxXdTh0V8KNmX20XDqqEVLcckWa4eyeFO0zf5HW9a vNQtvSh4L38xR3UCpzJJ7Pb+joVF+2SR4wn46Wspl6cjudOXcAAvqoMH4jI= X-Rspamd-Queue-Id: 374D596689 X-Spamd-Bar: +++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [5.33 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mx01.schlund.de]; RCPT_COUNT_TWO(0.00)[2]; SUBJECT_ENDS_EXCLAIM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[69.226.193.92.zen.spamhaus.org : 127.0.0.10]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.64)[0.637,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.97)[0.970,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[0.999,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[134.126.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.33)[ip: (1.68), ipnet: 212.227.0.0/16(-0.65), asn: 8560(0.63), country: DE(-0.01)] 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: Wed, 16 Jan 2019 10:44:30 -0000 A little addition: On Wed, 16 Jan 2019 10:09:15 +0000, Lorenzo Salvadore via freebsd-questions wrote: > The relation of libc with C is that it follows a standard which makes > writing C programs very easily. If you have some experience in C you > surely know the printf function: how the compiler knows what to do > when you write it in a source code? It knows it because it is written in > libc. And to the compiler, it doesn't even matter in which source language the machine code corresponding to printf() has been written in. There is a defined format for libraries (for static as well as dynamic use) which allows the compiler and linker to create the appropriate "hooks" to call functions. It does not matter if such a function has been written in C, in Rust, or in assembly. In fact, parts of FreeBSD's libc have been written in assembly (check for *.S files in /usr/src/lib/libc; some parts are machine-dependent, others are not. The _content_ of libc (as a concept different from the way of creation of libc) is defined by the C standard, i. e., which functions, variables, or macros the standard requires. This is where the name originates from. Do not confuse this with statements like "the libc is written in C", or "the libc is for programs written in C". :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...