473,661 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stdio.h ?

can "stdio.h" be OS specific at the kernal level or ? i know what I'm
trying to ask here but not sure how to word it :-)
--
Woodzy
http://www.rtdos.com/forum
Nov 14 '05 #1
53 4518
Sorry, could you try to reword your post. I am quite sure many would
like to answer your question.

Nov 14 '05 #2
In comp.lang.c "\(ProteanThrea d\)" <sy***@rtdos.co m> wrote:
can "stdio.h" be OS specific at the kernal level or ? i know what I'm
trying to ask here but not sure how to word it :-)


What means "OS specific at the kernal level"? If you have a kernel
header named "stdio.h" it got nothing to do with the file of the
same name used for userland programs. And the userland header also
depends on OS specific properties, the compiler and the libc, so it
won't be identical to a "stdio.h" you get for a different system/
compiler/libc combination.
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@p hysik.fu-berlin.de
\______________ ____________ http://www.toerring.de
Nov 14 '05 #3

[posting from comp.lang.c; fups set]

On Tue, 8 Mar 2005, (ProteanThread) wrote:

can "stdio.h" be OS specific at the kernal level or ? i know what I'm
trying to ask here but not sure how to word it :-)


You mean, what's "inside" <stdio.h>? The answer, as far as this
newsgroup is concerned (i.e., as far as the standard C language is
concerned) is: Whatever the implementor feels like. Could be completely
high-level stuff; could be lines and lines of machine-specific assembly
code; could be a bunch of Unix system calls; could be pink elephants
in tutus. We don't know what <stdio.h> "looks" like on your system, and
we don't care. You don't need to care, either, if all you're doing is
writing programs in C.

If your implementation is like many other implementations , you'll
actually have a text file somewhere on your hard disk called "stdio.h".
If you can find it, open it up and take a look. You'll probably find
out that it's full of arcane, basically incomprehensibl e pseudo-C with
lots of underscores in funny places. Don't ask us what it means; we
don't know. (Or rather, some of us probably do know what it all means
on /our/ systems, but may have no idea about yours --- and besides, if
we start explaining implementation internals to you, then we'll have to
explain implementation internals to everyone, and there are /hundreds/
of of implementations out there, all different. And then there wouldn't
be any room here to talk about C anymore.)

Bottom line: The implementation of <stdio.h> contains tygers. This
newsgroup doesn't talk about tygers. But if you have questions about
how to use <stdio.h> or the standard library functions it defines,
this is definitely the place to ask.

HTH,
-Arthur
Nov 14 '05 #4

<Je***********@ physik.fu-berlin.de> wrote in message
news:39******** *****@uni-berlin.de...

What means "OS specific at the kernal level"? If you have a kernel
header named "stdio.h" it got nothing to do with the file of the
same name used for userland programs. And the userland header also
depends on OS specific properties, the compiler and the libc, so it
won't be identical to a "stdio.h" you get for a different system/
compiler/libc combination.


so "stdio.h" is not the same not only from compiler to compiler but also
from OS to OS ?
Nov 14 '05 #5

"Minti" <im*******@gmai l.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Sorry, could you try to reword your post. I am quite sure many would
like to answer your question.


sorry, what I mean is "stdio.h" compiler dependent or OS dependent? or can
I create my own "stdio.h" lib for my own OS ?
Nov 14 '05 #6
"Arthur J. O'Dwyer" <aj*@nospam.and rew.cmu.edu> wrote in message
news:Pi******** *************** ***********@uni x43.andrew.cmu. edu...

You mean, what's "inside" <stdio.h>? The answer, as far as this
newsgroup is concerned (i.e., as far as the standard C language is
concerned) is: Whatever the implementor feels like. Could be completely
high-level stuff; could be lines and lines of machine-specific assembly
code; could be a bunch of Unix system calls; could be pink elephants
in tutus. We don't know what <stdio.h> "looks" like on your system, and
we don't care. You don't need to care, either, if all you're doing is
writing programs in C.
So its more compiler dependent than OS dependent?
If your implementation is like many other implementations , you'll
actually have a text file somewhere on your hard disk called "stdio.h".
If you can find it, open it up and take a look. You'll probably find
out that it's full of arcane, basically incomprehensibl e pseudo-C with
lots of underscores in funny places. Don't ask us what it means; we
don't know. (Or rather, some of us probably do know what it all means
on /our/ systems, but may have no idea about yours --- and besides, if
we start explaining implementation internals to you, then we'll have to
explain implementation internals to everyone, and there are /hundreds/
of of implementations out there, all different. And then there wouldn't
be any room here to talk about C anymore.)
But if i were designing my own OS, can I create my own custom "stdio.h" lib
?
Bottom line: The implementation of <stdio.h> contains tygers. This
newsgroup doesn't talk about tygers. But if you have questions about
how to use <stdio.h> or the standard library functions it defines,
this is definitely the place to ask.


ok, few more questions:
1. what's a tyger?
2. can the standard library be redefined? (i.e. create my own standard
library?)
3. is "stdio.h" always necessary in plain C?

I'm probably going to be sticking my foot in my mouth with the next
question, but -
Can I create my own subset of the C language with custom library functions?
Nov 14 '05 #7
(ProteanThread) wrote:
"Arthur J. O'Dwyer" <aj*@nospam.and rew.cmu.edu> wrote in message
news:Pi******** *************** ***********@uni x43.andrew.cmu. edu...
You mean, what's "inside" <stdio.h>? The answer, as far as this
newsgroup is concerned (i.e., as far as the standard C language is
concerned) is: Whatever the implementor feels like. Could be completely
high-level stuff; could be lines and lines of machine-specific assembly
code; could be a bunch of Unix system calls; could be pink elephants
in tutus. We don't know what <stdio.h> "looks" like on your system, and
we don't care. You don't need to care, either, if all you're doing is
writing programs in C.
So its more compiler dependent than OS dependent?


Both. You have to differentiate between the
interface (standard) and the implementation (by
essence not standard). The interface is specified
by the C standard and the implementation is
specified by the compiler.

There are many scenarios but here`s one: the OS
implements low-level functions. You have a C
compiler targeted for your system and it comes
with a standard library. What 'targeted' means is
that its C library makes system calls to your
kernel's low-level functions. Porting that
library to another platform will probably not
work, because it is inherently platform-specific,
as the compiler is.
If your implementation is like many other implementations , you'll
actually have a text file somewhere on your hard disk called "stdio.h".
If you can find it, open it up and take a look. You'll probably find
out that it's full of arcane, basically incomprehensibl e pseudo-C with
lots of underscores in funny places. Don't ask us what it means; we
don't know. (Or rather, some of us probably do know what it all means
on /our/ systems, but may have no idea about yours --- and besides, if
we start explaining implementation internals to you, then we'll have to
explain implementation internals to everyone, and there are /hundreds/
of of implementations out there, all different. And then there wouldn't
be any room here to talk about C anymore.)

But if i were designing my own OS, can I create my own custom "stdio.h" lib
?


The header should be about the same in all
libraries, because it specifies the interface.
Bottom line: The implementation of <stdio.h> contains tygers. This
newsgroup doesn't talk about tygers. But if you have questions about
how to use <stdio.h> or the standard library functions it defines,
this is definitely the place to ask.

ok, few more questions:
1. what's a tyger?


Dunno.
2. can the standard library be redefined? (i.e. create my own standard
library?)
The standard library *must* be implemented for
your platform! It is mandatory for you to
re-implement a working library or to start one
from scratch.
3. is "stdio.h" always necessary in plain C?
What do you mean exactly? It is necessary if the
program uses declarations from that header.
I'm probably going to be sticking my foot in my mouth with the next
question, but -
Can I create my own subset of the C language with custom library functions?


Yes. For example, Visual C++ adds many extensions
to the C++ language. Just make sure you specify
somewhere what is standard and what is not (and
make sure your standard library's implementation
does not use non-standard feature, as Visual C++
does).

By the way, you should remove comp.lang.c from the
crosspost list since your questions have nothing
to do with it (read its charter).
Jonathan
Nov 14 '05 #8
In article <1110314052.a01 71dc3b7d8af5190 5c6a79ed1062c0@ teranews>,
\(ProteanThread \) <sy***@rtdos.co m> wrote:
:sorry, what I mean is "stdio.h" compiler dependent or OS dependent?

Both. In fact, it need not even be text, according to the C89 standard.

:or can
:I create my own "stdio.h" lib for my own OS ?

You could, but don't expect the result to be portable.

Within the last couple of weeks, there was a thread here in comp.lang.c
to the effect that users are "prohibitte d from trying" to redefine
any routine in the standard library. I was the lone holdout for
the interpretation that the standard didn't actually prohibit you
from trying: it just couldn't promise that anything would work
properly if you did.
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest
Nov 14 '05 #9
In article <Xn************ *********@wagne r.videotron.net >,
Jonathan Mcdougall <jo************ ***@DELyahoo.ca > wrote:
:By the way, you should remove comp.lang.c from the
:crosspost list since your questions have nothing
:to do with it (read its charter).

And where exactly can that charter be found?

comp.lang.c is a rename of a news.* group. It effectively
predates charters. The corresponding news.* group did have a statement
of purpose, but you will, sad to say, get royally roasted if you
post according to that news.* statement of purpose. :(
--
Oh, to be a Blobel!
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2290
by: clusardi2k | last post by:
Hello, I'm trying to understand someone else code. The below compiles and works fine and dandy. #include <sys/types.h> #include "unistd.h" #include "stdio.h"
4
17074
by: Chad | last post by:
What purpose does __THROW serve in stdio.h. For example, in I see stuff like the following in stdio.h: /* Generate a temporary filename. */ extern char *tmpnam (char *__s) __THROW; __END_NAMESPACE_STD #ifdef __USE_MISC /* This is the reentrant variant of `tmpnam'. The only difference is that it does not allow S to be NULL. */
9
1723
by: sunway | last post by:
i have written a small program, it turns out to be wrong, while(read()!=EOF){ read(); read(); read(); } so,when read==EOF,the next read() will read a -1, and the program will go infinitely.
11
2764
by: talk | last post by:
hi,guy i have a question. are the functions in <stdio.h> system calls provided by operation system? if so, i want to know how C implements that we can call system calls by using the functions in <stdio.h>. i need your help, thanks a lot.
2
14567
by: david wolf | last post by:
My understanding is that cstdio basically is the same as stdio.h except the functions are in a namspace called std. However when I take a look at the content of the file cstdio, it has the following lines inside only: -------content of cstdio on red hat linux enterprise 3---- #ifndef __CSTDIO__ #define __CSTDIO__ #include <stdio.h> #endif
4
2980
by: SamG | last post by:
I have installed ubuntu 6.10 on my intel PC and when i try to write a small c code and compile it i get an error saying the is reference to stdio.h i checked /usr/include and /usr/local/include and i searched the whole system for stdio.h file but i was not able to find the file. My gcc is there but how come the stdio.h is not included. How to get around this problem, it seems non of the glibc include
17
8926
by: lak | last post by:
if i view stdio.h there are only symbolic constants. where is the definition of printf and scanf is available? i want to see the definition of printf and scanf and where it is stored?
1
1475
by: samoukos | last post by:
Hello i had to do this project but at school they tell me that it will be faster using stdio insteed of fstream... Is that right??? if it is faster can anyone suggest how this code will be using stdio???thank you???? here is the code: //Made by Samuel Johnson //email:sammojohn@gmail.com #include<iostream>
6
4871
by: hanaa | last post by:
Hello.. Is it okay to use functions such as setvbuf (that is defined in stdio.h) in a C++ program? I include stdio.h in the program and it works. Yet, I wonder if its okay.. stdio.h is a part of the standard C library and not standard C++ library, if I'm not wrong. I also want to know if many such other functions can be used in C++ programming. Is there a clear line between the standard libraries for C and C++? Is using either in the...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.