Sponsored Content
Top Forums Programming time_t data type-- what does start +1 mean? Post 83489 by jim mcnamara on Thursday 15th of September 2005 10:41:58 AM
Old 09-15-2005
Under some heavy-duty circumstances and with some versions of unix:
the order that data is written to a file may not be preserved. We had an old DEC-unix box that did that. I don't know that this is what you are seeing, but it's possible.

You can correct the problem with fflush():
Code:
fprintf(..........);
fflush(out);
fprintf(...........);

This has nothing to do with C in particular.
 

10 More Discussions You Might Find Interesting

1. Programming

trouble handling time_t and struct tm

--- (6 Replies)
Discussion started by: runawayNinja
6 Replies

2. Programming

FILE data type

Hi all, Can anyone tell me a little about the datatype FILE, which represents stream. What does its structure look like, and in which header file is it defined and so on... Ex : FILE *fp ; fp = fopen("filename", "w") ; (6 Replies)
Discussion started by: milhan
6 Replies

3. Programming

data type limitation

I am writing some code to do analysis on the file system (HP-UX 11.11). I am using stat(..) to get file information. My problem is that the file-size may exceed the data types defined in 'sys/stat.h' & 'sys/types.h' respectively. Thus file-sizes in the Giga-byte range are not read correctly.... (2 Replies)
Discussion started by: ALTRUNVRSOFLN
2 Replies

4. AIX

Value too large to be stored in data type???

Hello, I get this message : "Value too large to be stored in data type" when I try to open a 3Gb file. Can someone helps me to resolve the problem. Thank you very much (5 Replies)
Discussion started by: limame
5 Replies

5. Shell Programming and Scripting

Perl data type checking

I am using perl 5.8.0. I need to check some values to see it they are floats. Our system does not have Data::Types so I can't use is_float. Is there something else that I can use? The only thing in Data is Dump.pm. I am not allowed to download anything to our system so I have to use what I have.... (3 Replies)
Discussion started by: ajgwin
3 Replies

6. Web Development

Data type to use for prices with commas

Hi everybody, I`m very new with PHP and Databases and I having the follow issue with prices data.. The original information is in CSV files. The prices have formatted with commas and dots as follow: 12,300.99 -->(thousands separated by commas) 3,500.25 -->(thousands separated... (10 Replies)
Discussion started by: cgkmal
10 Replies

7. Programming

help with data type sizes

i'm using a C program and running it on a linux server, i got 2 adressess of 2 variables, and 2 addresses of 2 chars, and compared it. and got the size of a int and the size of a char. why is a size of a int (4 bytes) bigger then the size of a char (1 byte)? also if i do &a-&b i get 1, but if i... (30 Replies)
Discussion started by: omega666
30 Replies

8. UNIX for Advanced & Expert Users

When did UNIX start using encrypted passwords, and not displaying passwords when you type them in?

I've been using various versions of UNIX and Linux since 1993, and I've never run across one that showed your password as you type it in when you log in, or one that stored passwords in plain text rather than encrypted. I'm writing a script for work for a security audit, and two of the... (5 Replies)
Discussion started by: Anne Neville
5 Replies

9. AIX

AIX and Value too large to be stored in data type.

root@test8:/config1>oslevel -s 5300-01-00-0000 root@test8:/config1>oslevel -r 5300-01 while moving a file sized 9GB i got this message root@test8:/configapp>mv bkp_14JUN16_oraapp_2.tgz /oraapp bkp_14JUN16_oraapp_2.tgz: Value too large to be stored in data type. possibly need APAR... (2 Replies)
Discussion started by: filosophizer
2 Replies

10. Programming

Incompatible data type fpos_t in C

This is from a program I wrote over in 1998 that I am trying to compile on a linux machine: void write_line (FILE *fp, int rec_no, line_rec *arec) { fpos_t woffset; woffset = (rec_no - 1) * sizeof(line_rec); fsetpos(fp,&woffset); fwrite(arec,sizeof(line_rec),1,fp); }On the line... (2 Replies)
Discussion started by: wbport
2 Replies
TIME2POSIX(3)						   BSD Library Functions Manual 					     TIME2POSIX(3)

NAME
time2posix, time2posix_z, posix2time, posix2time_z, -- convert seconds since the Epoch LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <time.h> time_t time2posix(time_t t); time_t time2posix_z(const timezone_t tz, time_t t); time_t posix2time(time_t t); time_t posix2time_z(const timezone_t tz, time_t t); DESCRIPTION
IEEE Std 1003.1 (``POSIX.1'') legislates that a time_t value of 536457599 shall correspond to Wed Dec 31 23:59:59 UTC 1986. This effectively implies that POSIX time_t's cannot include leap seconds and, therefore, that the system time must be adjusted as each leap occurs. If the time package is configured with leap-second support enabled, however, no such adjustment is needed and time_t values continue to increase over leap events (as a true `seconds since...' value). This means that these values will differ from those required by POSIX by the net number of leap seconds inserted since the Epoch. Typically this is not a problem as the type time_t is intended to be (mostly) opaque -- time_t values should only be obtained-from and passed-to functions such as time(3), localtime(3), localtime_r(3), localtime_rz(3), mktime(3), mktime_z(3), and difftime(3). However, POSIX gives an arithmetic expression for directly computing a time_t value from a given date/time, and the same relationship is assumed by some (usually older) applications. Any programs creating/dissecting time_t's using such a relationship will typically not handle intervals over leap seconds correctly. The time2posix(), time2posix_z(), posix2time(), and posix2time_z() functions are provided to address this time_t mismatch by converting between local time_t values and their POSIX equivalents. This is done by accounting for the number of time-base changes that would have taken place on a POSIX system as leap seconds were inserted or deleted. These converted values can then be used in lieu of correcting the older applications, or when communicating with POSIX-compliant systems. time2posix() and time2posix_z() are single-valued. That is, every local time_t corresponds to a single POSIX time_t. posix2time() and posix2time() are less well-behaved: for a positive leap second hit the result is not unique, and for a negative leap second hit the corre- sponding POSIX time_t doesn't exist so an adjacent value is returned. Both of these are good indicators of the inferiority of the POSIX rep- resentation. The ``z'' variants of the two functions behave exactly like their counterparts, but they operate in the given tz argument which was previ- ously allocated using tzalloc(3) and are re-entrant. The following table summarizes the relationship between a time_t and its conversion to, and back from, the POSIX representation over the leap second inserted at the end of June, 1993. DATE TIME T X=time2posix(T) posix2time(X) 93/06/30 23:59:59 A+0 B+0 A+0 93/06/30 23:59:60 A+1 B+1 A+1 or A+2 93/07/01 00:00:00 A+2 B+1 A+1 or A+2 93/07/01 00:00:01 A+3 B+2 A+3 A leap second deletion would look like... DATE TIME T X=time2posix(T) posix2time(X) ??/06/30 23:59:58 A+0 B+0 A+0 ??/07/01 00:00:00 A+1 B+2 A+1 ??/07/01 00:00:01 A+2 B+3 A+2 [Note: posix2time(B+1) => A+0 or A+1] If leap-second support is not enabled, local time_t's and POSIX time_t's are equivalent, and both time2posix() and posix2time() degenerate to the identity function. SEE ALSO
difftime(3), localtime(3), localtime_r(3), localtime_rz(3), mktime(3), mktime_z(3), time(3), tzalloc(3) BSD
December 4, 2010 BSD
All times are GMT -4. The time now is 11:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy