OSDN Git Service

16bc8736c0622c16dd0d8eb306f4f348ca094908
[linuxjm/LDP_man-pages.git] / original / man3 / dysize.3
1 .\"  Copyright 2001 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" aeb: some corrections
26 .TH DYSIZE 3 2013-09-25 "GNU" "Linux Programmer's Manual"
27 .SH NAME
28 dysize \- get number of days for a given year
29 .SH SYNOPSIS
30 .B "#include <time.h>"
31 .sp
32 .BI "int dysize(int " year );
33 .sp
34 .in -4n
35 Feature Test Macro Requirements for glibc (see
36 .BR feature_test_macros (7)):
37 .in
38 .sp
39 .BR dysize ():
40 _BSD_SOURCE || _SVID_SOURCE
41 .SH DESCRIPTION
42 The function returns 365 for a normal year and 366 for a leap year.
43 The calculation for leap year is based on:
44 .sp
45 (year) %4 == 0 && ((year) %100 != 0 || (year) %400 == 0)
46 .sp
47 The formula is defined in the macro
48 .I __isleap(year)
49 also found in
50 .IR <time.h> .
51 .SH ATTRIBUTES
52 .SS Multithreading (see pthreads(7))
53 The
54 .BR dysize ()
55 function is thread-safe.
56 .SH CONFORMING TO
57 This function occurs in SunOS 4.x.
58 .SH NOTES
59 This is a compatibility function only.
60 Don't use it in new programs.
61 .\" The SCO version of this function had a year-2000 problem.
62 .SH SEE ALSO
63 .BR strftime (3)
64 .SH COLOPHON
65 This page is part of release 3.67 of the Linux
66 .I man-pages
67 project.
68 A description of the project,
69 information about reporting bugs,
70 and the latest version of this page,
71 can be found at
72 \%http://www.kernel.org/doc/man\-pages/.