473,569 Members | 2,991 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
53 4483
In article <1110313975.c43 093294dde52595a 6a7a3c877c3a48@ teranews>,
\(ProteanThread \) <sy***@rtdos.co m> wrote:
:so "stdio.h" is not the same not only from compiler to compiler but also
:from OS to OS ?

Different from OS to OS for certain.

On unix-type systems that are supplied with <stdio.h> and so on
as part of the OS, most compiler writers try to work within what
is provided. Unix(tm) OS's have to have ANSI-compliant header
files in order to pass the Unix(tm) conformance tests.

Once you get into Windows and so on, you are dealing more with
competing compilers which might use completely different header files.
--
Warning: potentially contains traces of nuts.
Nov 14 '05 #11
In article <1110314389.d45 27d3074cde45f4a ce6396d62a5df4@ teranews>,
\(ProteanThread \) <sy***@rtdos.co m> wrote:
:ok, few more questions:
:1. what's a tyger?

The old spelling of 'tiger'. On old maps, in places unknown and
potentially dangerous, it was supposedly common to put on the map,
"Beyond here be tygers."

:3. is "stdio.h" always necessary in plain C?

No! The C89 standard says in a footnote,
89. A header is not nessisarily a source file [...]
--
Are we *there* yet??
Nov 14 '05 #12
"Walter Roberson" <ro******@ibd.n rc-cnrc.gc.ca> wrote in message
news:d0******** *@canopus.cc.um anitoba.ca...

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. :(

I wonder if he means "comp.lang.c.mo derated" ?
Nov 14 '05 #13

"Walter Roberson" <ro******@ibd.n rc-cnrc.gc.ca> wrote in message
news:d0******** @canopus.cc.uma nitoba.ca...

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

So in order to keep it portable I'd want to keep my own definitions separate
from the standard library ?
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.


Well, aren't there a few well used languages that are either a subset of C
or a variation of C ?
Nov 14 '05 #14
"Jonathan Mcdougall" <jo************ ***@DELyahoo.ca > wrote in message
news:Xn******** *************@w agner.videotron .net...

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.

ok that makes sense.
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.
so really, i'd want to keep the standard C library definitions intact and
just add my own OS specific functions?
The header should be about the same in all
libraries, because it specifies the interface.
But would I want to make "stdio.h" more specific to my OS / Compiler ?
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.
Any examples?
What do you mean exactly? It is necessary if the
program uses declarations from that header.
But can the header be defined to use only functions that pertain to my OS ?
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).
Makes sense (but microsoft usually never follows the rules anyways)
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).


I plan on only using C (or a subset of C) and Assembler for my OS :-)
Nov 14 '05 #15
"Walter Roberson" <ro******@ibd.n rc-cnrc.gc.ca> wrote in message
news:d0******** **@canopus.cc.u manitoba.ca...

The old spelling of 'tiger'. On old maps, in places unknown and
potentially dangerous, it was supposedly common to put on the map,
"Beyond here be tygers."

lol. now i understand the relevance. :-)
:3. is "stdio.h" always necessary in plain C?

No! The C89 standard says in a footnote,
89. A header is not nessisarily a source file [...]
is C89 the last C standard or most recent definition ?
--
Are we *there* yet??


I wish. :-)
Nov 14 '05 #16
Jonathan Mcdougall wrote:
(ProteanThread) wrote:

.... snip ...

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


Dunno.


It is closely related to a tigger (spelled with a double guh) and
specifies a striped yet powerful mythical beast that is sometimes
friendly. Cartologists have been known to specify areas where
"Here there be tygers". Cartoonists and illustrators tend to lean
towards tiggers. The C standard stands aloof in the matter and
allows you to redefine both flavors.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!

Nov 14 '05 #17
In article <1110320853.164 b2acfba50312e86 5d1735f8b3c98a@ teranews>,
\(ProteanThread \) <sy***@rtdos.co m> wrote:
:So in order to keep it portable I'd want to keep my own definitions separate
:from the standard library ?

Right. But I'm not sure how you intend to impliment a portable
operating system? I/O is always going to be platform dependant.

:Well, aren't there a few well used languages that are either a subset of C
:or a variation of C ?

Subset? I can't think of any.
Variation? Some people would consider C++, C#, and Java to be
"variations " on C.

If you are trying to find a language that says, "It's okay to
redefine the system library routines," then the only one I can think
of at the moment is Forth. LISP and Scheme too maybe.
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers
Nov 14 '05 #18
In article <1110321509.874 f748acd8c835cd7 95a4a9d0a5dfd1@ teranews>,
\(ProteanThread \) <sy***@rtdos.co m> wrote:

:is C89 the last C standard or most recent definition ?

There is a 1999 international C standard. There are, though,
not a great number of compilers built for that standard yet.
--
"I want to make sure [a user] can't get through ... an online
experience without hitting a Microsoft ad"
-- Steve Ballmer [Microsoft Chief Executive]
Nov 14 '05 #19
On Tue, 8 Mar 2005 13:34:09 -0700, in comp.lang.c , "\(ProteanThrea d\)"
<sy***@rtdos.co m> wrote:

"Minti" <im*******@gmai l.com> wrote in message
news:11******* *************** @f14g2000cwb.go oglegroups.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?


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


Of course
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #20

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

Similar topics

2
2285
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
17052
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
1715
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
2755
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
14554
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
2976
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. ...
17
8917
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
1470
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
4864
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++...
0
7618
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...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2117
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
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
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...

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.