0% found this document useful (0 votes)
1 views37 pages

The Linux programming interface a Linux and UNIX system programming handbook 1st Edition Michael Kerrisk instant download

The document provides information about 'The Linux Programming Interface,' a comprehensive guide to Linux and UNIX system programming by Michael Kerrisk. It covers over 500 system calls and library functions, with numerous examples and detailed explanations, making it a valuable resource for both new and experienced programmers. The book emphasizes UNIX standards and includes practical applications for system programming.

Uploaded by

evkhgwzhq3570
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views37 pages

The Linux programming interface a Linux and UNIX system programming handbook 1st Edition Michael Kerrisk instant download

The document provides information about 'The Linux Programming Interface,' a comprehensive guide to Linux and UNIX system programming by Michael Kerrisk. It covers over 500 system calls and library functions, with numerous examples and detailed explanations, making it a valuable resource for both new and experienced programmers. The book emphasizes UNIX standards and includes practical applications for system programming.

Uploaded by

evkhgwzhq3570
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

The Linux programming interface a Linux and UNIX

system programming handbook 1st Edition Michael


Kerrisk download pdf

https://ebookultra.com/download/the-linux-programming-interface-a-linux-
and-unix-system-programming-handbook-1st-edition-michael-kerrisk/

Discover thousands of ebooks and textbooks at ebookultra.com


download your favorites today!
We have selected some products that you may be interested in
Click the link to download now or visit ebookultra.com
for more options!.

The Linux Programming Interface 1st Edition Michael


Kerrisk

https://ebookultra.com/download/the-linux-programming-interface-1st-
edition-michael-kerrisk/

Linux system programming talking directly to the kernel


and C library 2nd Edition Robert Love

https://ebookultra.com/download/linux-system-programming-talking-
directly-to-the-kernel-and-c-library-2nd-edition-robert-love/

C Programming in Linux 1st edition Edition Haskins D.

https://ebookultra.com/download/c-programming-in-linux-1st-edition-
edition-haskins-d/

DB2 9 for Linux UNIX and Windows George Baklarz

https://ebookultra.com/download/db2-9-for-linux-unix-and-windows-
george-baklarz/
A Practical Guide to Linux Commands Editors and Shell
Programming 2nd Edition Mark G. Sobell

https://ebookultra.com/download/a-practical-guide-to-linux-commands-
editors-and-shell-programming-2nd-edition-mark-g-sobell/

Linux System Administration Second Edition Craig Hunt


Linux Library Vicki Stanfield

https://ebookultra.com/download/linux-system-administration-second-
edition-craig-hunt-linux-library-vicki-stanfield/

UNIX Shell programming 3rd Edition Stephen Kochan

https://ebookultra.com/download/unix-shell-programming-3rd-edition-
stephen-kochan/

Linux Cookbook Essential Skills for Linux Users and System


Network Administrators 2nd ed 2nd Edition Carla Schroder

https://ebookultra.com/download/linux-cookbook-essential-skills-for-
linux-users-and-system-network-administrators-2nd-ed-2nd-edition-
carla-schroder/

Learning the bash Shell Unix Shell Programming 3rd Edition


Cameron Newham

https://ebookultra.com/download/learning-the-bash-shell-unix-shell-
programming-3rd-edition-cameron-newham/
The Linux programming interface a Linux and UNIX
system programming handbook 1st Edition Michael
Kerrisk Digital Instant Download
Author(s): Michael Kerrisk
ISBN(s): 9781593272913, 159327291X
Edition: 1
File Details: PDF, 6.92 MB
Year: 2010
Language: english
The definiTive guide To Linux
and unix sysTem Programming
®
The Linux
The Linux Programming Interface is the definitive guide
to the Linux and UNIX programming interface—the
f

f
Write secure programs
Write multithreaded programs using POSIX threads
Programming
inTerface
interface employed by nearly every application that f Build and use shared libraries

Programming
runs on a Linux or UNIX system. f Perform interprocess communication using pipes,
In this authoritative work, Linux programming message queues, shared memory, and semaphores
expert Michael Kerrisk provides detailed descriptions f Write network applications with the sockets API
of the system calls and library functions that you need
While The Linux Programming Interface covers a wealth

The Linux
inTerface
in order to master the craft of system programming,
of Linux-specific features, including epoll, inotify, and
and accompanies his explanations with clear, complete
A Linux and UNIX System Programming Handbook
®
the /proc file system, its emphasis on UNIX standards
example programs.
(POSIX.1-2001/SUSv3 and POSIX.1-2008/SUSv4)
You’ll find descriptions of over 500 system calls
makes it equally valuable to programmers working on
and library functions, and more than 200 example pro-
other UNIX platforms.
grams, 88 tables, and 115 diagrams. You’ll learn how to:
The Linux Programming Interface is the most com- Michael KerrisK
f Read and write files efficiently prehensive single-volume work on the Linux and UNIX
f Use signals, clocks, and timers programming interface, and a book that’s destined to
f Create processes and execute programs become a new classic.

about the author


Michael Kerrisk (http://man7.org/) has been using and programming UNIX systems
for more than 20 years, and has taught many week-long courses on UNIX system
programming. Since 2004, he has maintained the man-pages project, which
produces the manual pages describing the Linux kernel and glibc programming
APIs. He has written or cowritten more than 250 of the manual pages and is actively
involved in the testing and design review of new Linux kernel-userspace interfaces.
Michael lives with his family in Munich, Germany.

covers current uNiX standards (PosiX.1-2001/susv3 and PosiX.1-2008/susv4)


KerrisK
T H E F I N E ST I N G E E K E N T E RTA I N M E N T ™ $ 99.95 ($114.95 CDN ) Shelve In: linux/programming
w w w.nostarch.com

ISBN: 978-1-59327-220-3
5 999 5

9 781593 272203 6 89145 72200 0

This logo applies only to the text stock.


PRAISE FOR THE LINUX PROGRAMMING INTERFACE

“If I had to choose a single book to sit next to my machine when writing
software for Linux, this would be it.”
—MARTIN LANDERS, SOFTWARE ENGINEER, GOOGLE

“This book, with its detailed descriptions and examples, contains everything
you need to understand the details and nuances of the low-level programming
APIs in Linux . . . no matter what the level of reader, there will be something
to be learnt from this book.”
—MEL GORMAN, AUTHOR OF Understanding the Linux Virtual Memory Manager

“Michael Kerrisk has not only written a great book about Linux programming
and how it relates to various standards, but has also taken care that bugs he
noticed got fixed and the man pages were (greatly) improved. In all three
ways, he has made Linux programming easier. The in-depth treatment of
topics in The Linux Programming Interface . . . makes it a must-have reference
for both new and experienced Linux programmers.”
—ANDREAS JAEGER, PROGRAM MANAGER, OPENSUSE, NOVELL

“Michael’s inexhaustible determination to get his information right, and to


express it clearly and concisely, has resulted in a strong reference source for
programmers. While this work is targeted at Linux programmers, it will be of
value to any programmer working in the UNIX/POSIX ecosystem.”
—DAVID BUTENHOF, AUTHOR OF Programming with POSIX Threads AND
CONTRIBUTOR TO THE POSIX AND UNIX STANDARDS

“ . . . a very thorough—yet easy to read—explanation of UNIX system and


network programming, with an emphasis on Linux systems. It’s certainly a
book I’d recommend to anybody wanting to get into UNIX programming
(in general) or to experienced UNIX programmers wanting to know ‘what’s
new’ in the popular GNU/Linux system.”
—FERNANDO GONT, NETWORK SECURITY RESEARCHER, IETF PARTICIPANT, AND
RFC AUTHOR
“ . . . encyclopedic in the breadth and depth of its coverage, and textbook-
like in its wealth of worked examples and exercises. Each topic is clearly
and comprehensively covered, from theory to hands-on working code.
Professionals, students, educators, this is the Linux/UNIX reference that
you have been waiting for.”
—ANTHONY ROBINS, ASSOCIATE PROFESSOR OF COMPUTER SCIENCE, THE
UNIVERSITY OF OTAGO

“I’ve been very impressed by the precision, the quality and the level of detail
Michael Kerrisk put in his book. He is a great expert of Linux system calls
and lets us share his knowledge and understanding of the Linux APIs.”
—CHRISTOPHE BLAESS, AUTHOR OF Programmation système en C sous Linux

“ . . . an essential resource for the serious or professional Linux and UNIX


systems programmer. Michael Kerrisk covers the use of all the key APIs
across both the Linux and UNIX system interfaces with clear descriptions
and tutorial examples and stresses the importance and benefits of following
standards such as the Single UNIX Specification and POSIX 1003.1.”
—ANDREW JOSEY, DIRECTOR, STANDARDS, THE OPEN GROUP, AND CHAIR OF
THE POSIX 1003.1 WORKING GROUP

“What could be better than an encyclopedic reference to the Linux system,


from the standpoint of the system programmer, written by none other than
the maintainer of the man pages himself? The Linux Programming Interface is
comprehensive and detailed. I firmly expect it to become an indispensable
addition to my programming bookshelf.”
—BILL GALLMEISTER, AUTHOR OF POSIX.4 Programmer’s Guide: Programming for
the Real World

“ . . . the most complete and up-to-date book about Linux and UNIX system
programming. If you’re new to Linux system programming, if you’re a UNIX
veteran focused on portability while interested in learning the Linux way,
or if you’re simply looking for an excellent reference about the Linux pro-
gramming interface, then Michael Kerrisk’s book is definitely the companion
you want on your bookshelf.”
—LOÏC DOMAIGNÉ, CHIEF SOFTWARE ARCHITECT (EMBEDDED), CORPULS.COM
San Francisco
THE LINUX PROGRAMMING INTERFACE. Copyright © 2010 by Michael Kerrisk.

All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior
written permission of the copyright owner and the publisher.

14 13 12 11 10 123456789

ISBN-10: 1-59327-220-0
ISBN-13: 978-1-59327-220-3

Publisher: William Pollock


Production Editor: Riley Hoffman
Cover Design: Octopod Studios
Front Cover Photo: Rob Suisted
Back Cover Photo: Lynley Cook
Copyeditor: Marilyn Smith
Compositor: Susan Glinert Stevens
Proofreader: Linda Seifert
For technical reviewers, please refer to the author’s acknowledgements

For information on book distributors or translations, please contact No Starch Press, Inc. directly:
No Starch Press, Inc.
38 Ringold Street, San Francisco, CA 94103
phone: 415.863.9900; fax: 415.863.9950; [email protected]; www.nostarch.com

Library of Congress Cataloging-in-Publication Data


Kerrisk, Michael, 1961-
The Linux programming interface : a Linux and UNIX system programming handbook / by Michael Kerrisk.
p. cm.
Includes bibliographical references and index.
ISBN-13: 978-1-59327-220-3 (hardcover)
ISBN-10: 1-59327-220-0 (hardcover)
1. Linux. 2. UNIX (Computer file) 3. Operating systems (Computers) I. Title.
QA76.76.O63K496 2010
005.4'32--dc22
2010001947

No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and
company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark
symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the
benefit of the trademark owner, with no intention of infringement of the trademark.
®
UNIX is a registered trademark of The Open Group.

The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been
taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any
person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the
information contained in it.

This logo applies only to the text stock.


For Cecilia, who lights up my world.
BRIEF CONTENTS

Preface ..................................................................................................................... xxxi

Chapter 1: History and Standards .................................................................................... 1

Chapter 2: Fundamental Concepts ................................................................................. 21

Chapter 3: System Programming Concepts...................................................................... 43

Chapter 4: File I/O: The Universal I/O Model................................................................. 69

Chapter 5: File I/O: Further Details ................................................................................ 89

Chapter 6: Processes .................................................................................................. 113

Chapter 7: Memory Allocation..................................................................................... 139

Chapter 8: Users and Groups ...................................................................................... 153

Chapter 9: Process Credentials .................................................................................... 167

Chapter 10: Time....................................................................................................... 185

Chapter 11: System Limits and Options......................................................................... 211

Chapter 12: System and Process Information ................................................................. 223

Chapter 13: File I/O Buffering..................................................................................... 233

Chapter 14: File Systems ............................................................................................ 251

Chapter 15: File Attributes .......................................................................................... 279

Chapter 16: Extended Attributes .................................................................................. 311

Chapter 17: Access Control Lists .................................................................................. 319

Chapter 18: Directories and Links ................................................................................ 339

Chapter 19: Monitoring File Events .............................................................................. 375


Random documents with unrelated
content Scribd suggests to you:
me, that when on a visit somewhere, he had seen and partially
read a work of Dr. Smith on the evidences of Christianity which
had led him to change his views about the Christian religion;
that he would like to get that work to finish the reading of it,
and also to make the acquaintance of Dr. Smith. I was an elder
in Dr. Smith's church, and took Dr. Smith to Mr. Lincoln's office
and introduced him, and Dr. Smith gave Mr. Lincoln a copy of his
book, as I know, at his own request.
Yours, &c.,
Thos. Lewis.

There are many others who can testify that Mr. Lincoln, both publicly
and privately while at Springfield, made the admission of his belief in
the truth of the Christian religion. He did it in most unequivocal
language, in addresses before the Bible Society and in Sabbath
school.
I next refer to the testimony of Rev. Dr. Gurley, Mr. Lincoln's pastor
at Washington City. Even if, before his election to the Presidency, Mr.
Lincoln had entertained the sentiments attributed to him, after he
had reached the pinnacle of political elevation, there was certainly
no necessity for him any longer to be "playing a sharp game with
the Christians," and destroying his peace of mind by wearing the
mask of hypocrisy. He was surely free now to worship where he felt
most comfortable. But we no sooner find him in Washington than we
find him settling down under the ministry of Dr. Gurley, a sound and
orthodox minister of the gospel of Jesus Christ. Dr. Gurley was his
intimate friend, and spiritual counselor and adviser, during the most
trying and difficult time of his life. He was with him not only in the
hours of his personal family bereavement, but when his heart was
heavy and perplexed with the welfare of his country. Having been
associated with Dr. Gurley in the charge of his pulpit for a time
previous to his death, and being intimately acquainted with him, I
have had the opportunity of knowing what his views of Mr. Lincoln's
sentiments were. In the funeral oration which Dr. Gurley delivered in
Washington, he says:
"Probably since the days of Washington no man was ever so
deeply and firmly embedded and enshrined in the hearts of the
people as Abraham Lincoln. Nor was it a mistaken confidence
and love. He deserved it—deserved it all. He merited it by his
character, by his acts, and by the whole tone and tenor of his
life.... His integrity was thorough, all-pervading, all-controlling
and incorruptible. He saw his duty as the Chief Magistrate of a
great and imperiled people, and he determined to do his duty,
seeking the guidance, and leaning on the arm of Him of whom
it is written: 'He giveth power to the faint, and to them that
have no might He increaseth strength.'
"Never shall I forget the emphatic and deep emotion with which
he said in this very room, to a company of clergymen who
called to pay their respects to him in the darkest days of our
civil conflict: 'Gentlemen, my hope of success in this struggle
rests on that immutable foundation, the justness and the
goodness of God; and when events are very threatening I shall
hope that in some way all will be well in the end, because our
cause is just and God will be on our side.'"

This was uttered when Dr. Gurley was not aware, as I suppose, that
Mr. Lincoln had ever been charged with entertaining infidel
sentiments. While sitting in the study one day with him, conversing
on Mr. Lincoln's character, I asked him about the rumor of his
infidelity then being circulated by Mr. Herndon. He said, "I do not
believe a word of it. It could not have been true of him while here,
for I have had frequent and intimate conversations with him on the
subject of the Bible and the Christian religion, when he could have
had no motive to deceive me, and I considered him sound not only
on the truth of the Christian religion but on all its fundamental
doctrines and teaching. And more than that: in the latter days of his
chastened and weary life, after the death of his son Willie, and his
visit to the battlefield of Gettysburg, he said, with tears in his eyes,
that he had lost confidence in everything but God, and that he now
believed his heart was changed, and that he loved the Saviour, and if
he was not deceived in himself, it was his intention soon to make a
profession of religion." Language to this effect Mr. Lincoln, it
appears, used in conversation with other persons, and I refer next to
the corroborating testimony of Noah Brooks, Esq., now associated
with the New York Tribune. This gentleman has already published
most interesting testimony in relation to Mr. Lincoln's religious
sentiments in Harper's Monthly of July, 1865. In order that his
testimony may be fully appreciated, I will here state, on the
authority of a mutual friend, that "Mr. Brooks is himself an earnest
Christian man, and had the appointment of private secretary to the
President, to which office he would have acceded had Mr. Lincoln
lived. He was so intimate with the President that he visited him
socially at times when others were refused admission, took tea with
the family, spending evenings with him, reading to him, and
conversing with him freely on social and religious topics, and in my
opinion knows more of the secret inner life and religious views of Mr.
Lincoln, at least during the term of his presidency, than any man
living." The following is a letter which I have received from Mr.
Brooks in relation to his views of Mr. Lincoln's religious sentiments:

New York, Dec. 31st, 1872.


Rev. J. A. Reed:
My dear Sir—In addition to what has appeared from my pen, I
will state that I have had many conversations with Mr. Lincoln,
which were more or less of a religious character, and while I
never tried to draw anything like a statement of his views from
him, yet he freely expressed himself to me as having "a hope of
blessed immortality through Jesus Christ." His views seemed to
settle so naturally around that statement, that I considered no
other necessary. His language seemed not that of an inquirer,
but of one who had a prior settled belief in the fundamental
doctrines of the Christian religion. Once or twice, speaking to
me of the change which had come upon him, he said, while he
could not fix any definite time, yet it was after he came here,
and I am very positive that in his own mind he identified it with
about the time of Willie's death. He said, too, that after he went
to the White House he kept up the habit of daily prayer.
Sometimes he said it was only ten words, but those ten words
he had. There is no possible reason to suppose that Mr. Lincoln
would ever deceive me as to his religious sentiments. In many
conversations with him, I absorbed the firm conviction that Mr.
Lincoln was at heart a Christian man, believed in the Saviour,
and was seriously considering the step which would formally
connect him with the visible Church on earth. Certainly, any
suggestion as to Mr. Lincoln's skepticism or infidelity, to me who
knew him intimately from 1862 till the time of his death, is a
monstrous fiction—a shocking perversion.
Yours truly,
Noah Brooks.

The following extract I add also from Mr. Brooks's article in Harper's
Monthly of July, 1865: "There was something touching in his childlike
and simple reliance on Divine aid, especially when in such
extremities as he sometimes fell into; then, though prayer and
reading the Scriptures was his constant habit, he more earnestly
than ever sought that strength which is promised when mortal help
faileth. He said once, 'I have been many times driven to my knees
by the overwhelming conviction that I had nowhere else to go. My
own wisdom, and that of all about me, seemed insufficient for that
day.' At another time he said,

'I am very sure that if I do not go away from here a wiser man,
I shall go away a better man for having learned here what a
very poor sort of a man I am.'"

Mr. Carpenter, author of Six Months in the White House, whose


intimacy with Mr. Lincoln gives importance to his testimony, says that
"he believed Mr. Lincoln to be a sincere Christian," and among other
proofs of it gives another well-authenticated admission (made by Mr.
Lincoln to an estimable lady of Brooklyn, laboring in the Christian
Commission) of a change of heart, and of his intention at some
suitable opportunity to make a profession of religion.
Mr. Newton Bateman, Superintendent of Public Instruction in the
State of Illinois, a gentleman of rare literary attainments, and of
unquestionable veracity, has given very important testimony in
relation to one particular point, more especially, Mr. Lincoln's belief in
the divinity of Jesus Christ. Both Mr. Herndon and Mr. Lamon persist
in asserting that Mr. Lincoln never used the name of Jesus Christ
except to deny His divinity, and that Mr. Bateman is "the sole and
only man who dare say that Mr. Lincoln believed Jesus Christ to be
the Son of God."
Mr. Bateman testifies that in 1860, Mr. Lincoln in conversation with
him used the following language: "I know that there is a God, and
that He hates injustice and slavery. I see the storm coming, and I
know that His hand is in it. If He has a place and a work for me, and
I think He has, I believe I am ready. I am nothing, but truth is
everything. I know I am right, because I know that liberty is right,
for Christ teaches it and Christ is God. I have told them a house
divided against itself cannot stand; and Christ and reason say the
same, and they will find it so," &c. This testimony was originally
given in Holland's Life of Lincoln. Mr. Herndon, at first unwilling to
impeach Mr. Bateman's veracity, suggests a doubt "whether he is
correctly reported in Holland's history"; presently, however,
summoning courage, he ventures the affirmation: "On my word the
world may take it for granted that Holland is wrong; that he does
not state Mr. Lincoln's views correctly." He then goes on to say that
"between himself and Dr. Holland, Mr. Bateman is not in a very
pleasant situation." We have seen, however, that Mr. Herndon's
"word," in a matter where his prejudices are so violent and his
convictions so obstinate, is hardly a sufficient denial with which to
oppose the deliberate and unretracted statement of an intelligent
and reputable witness. And Mr. Bateman has no need to be
disturbed, so long as the "unpleasantness" of his situation is
occasioned by no more serious discomfort than Mr. Herndon's
unsupported contradiction. As the matter now stands, Mr. Herndon
offers a denial, based on general impressions as to Mr. Lincoln's
character, against the direct, specific, and detailed testimony of a
careful and competent man as to what he heard with his own ears.
Mr. Herndon simply did not hear what Mr. Bateman did hear; and is
in the position of that Irishman on trial for his life, who, when one
witness swore directly that he saw the accused commit the crime,
proposed to put upon the stand a dozen witnesses who could swear
they did not see him.
Mr. Lamon also states that Mr. Bateman is a respectable citizen,
whose general reputation for truth and veracity is not to be
impeached, but his story, as reported in Holland's Life of Lincoln, is
so inconsistent with Mr. Lincoln's whole character that it must be
rejected as altogether incredible. Unfortunately, however, for Mr.
Lamon, he has not so impressed us with the trustworthy nature of
the materials of his own book, as that we can afford to distrust the
honesty and integrity of either Dr. Holland or Mr. Bateman for his
sake. If anybody's story of Mr. Lincoln's life and sentiments is to be
"rejected as inconsistent and altogether incredible," the testimony
thus far would seem to indicate that it is Mr. Lamon's story. At least
that is the "unpleasant situation" in which we shall leave the matter,
so far as Mr. Bateman and Dr. Holland are concerned in it.
But Mr. Bateman is not the only one who can testify that Mr. Lincoln
did use the name of the Saviour, and believed him to be the Christ of
God. I have given several instances already in which he used the
name of Christ as his Saviour, and avowed that he loved Him.
Moreover, he could not have avowed his belief in the truth of the
Christian religion, as many witnesses testify, if he did not believe
Jesus to be the Christ of God.
To the various testimony which we have thus far cited it only
remains for me to add the testimony of his own lips. In his address
to the colored people of Baltimore, on the occasion of the
presentation of a copy of the Bible, Mr. Lincoln said: "In regard to
this great Book, I have only to say, it is the best gift which God has
ever given to man. All the good from the Saviour of the world is
communicated to us through this Book."
To the Hon. H. C. Deming, of Connecticut, he said that the "article of
his faith was contained in the Saviour's condensed statement of both
law and gospel—'Thou shalt love the Lord thy God with all thy heart,
and with all thy soul, and with all thy strength, and with all thy mind,
and thy neighbor as thyself.'"
Mr. Herndon affirms that Mr. Lincoln did not believe in the "Christian
dogma of the forgiveness of sin": he believed that "God would not
and could not forgive sin. He did not believe in forgiveness through
Christ, nor in fact in any doctrine of forgiveness. In reading Mr.
Lincoln's proclamations, however, we find that he does very distinctly
recognize the doctrine of the forgiveness of sin on the part of God,
and very earnestly implores the people to seek the forgiveness of
their sins. In his proclamation of a fast day, August, 1861, are these
words:
"And, whereas, it is fit and becoming in all people, at all times, to
acknowledge and revere the supreme government of God; to bow in
humble submission to his chastisements; to confess and deplore
their sins and transgressions, in the full conviction that the fear of
the Lord is the beginning of wisdom, and to pray with all fervency
and contrition for the pardon of their past offenses, and for a
blessing on their present and prospective action," etc.
Read also his proclamation enforcing the observance of the Christian
Sabbath in the Army and Navy, and ask yourself, Could an infidel
have done this?

The President, Commander-in-Chief of the Army and Navy,


desires and enjoins the orderly observance of the Sabbath by
the officers and men in the military and naval service. The
importance for man and beast of the prescribed weekly rest, the
sacred rights of Christian soldiers and sailors, a becoming
deference to the best sentiment of a Christian people, and a
due regard for the Divine will, demand that Sunday labor in the
Army and Navy be reduced to the measure of a strict necessity.
The discipline and character of the National forces should not
suffer, nor the cause they defend be imperiled, by the
profanation of the day and the name of the Most High. At this
time of public distress, adopting the words of Washington in
1776, "Men may find enough to do in the service of God and
their country without abandoning themselves to vice and
immorality." The first general order issued by the Father of his
Country, after the Declaration of Independence, indicates the
spirit in which our institutions were founded and should ever be
defended: "The General hopes and trusts that every officer and
man will endeavor to live and act as becomes a Christian soldier
defending the dearest rights and liberties of his country."
Abraham Lincoln.

Besides all this, we find Mr. Lincoln often using the very language of
the Saviour, as not only expressing but giving the sanction of Divine
authority to his own views and opinions. What a remarkable instance
of it in the solemn words that fell from his lips in his last inaugural,
as he stood on the steps of the Capitol! Standing upon the verge of
his grave, as he was that day, and addressing his last official words
to his countrymen, his lips touched as with the finger of inspiration,
he said:
"The Almighty has His own purposes. 'Woe unto the world because
of offenses, for it must needs be that offenses will come; but woe
unto the man by whom the offense cometh.' If we shall suppose
that American Slavery is one of these offenses which, in the
providence of God, must needs come, but which, having continued
through His appointed time, He now wills to remove, and that He
gives to both North and South this terrible war as the woe due to
those by whom the offense came, shall we discern any departure
therein from those Divine attributes which the believers in a living
God always ascribe to him? Fondly do we hope, fervently do we
pray, that the mighty scourge of war may pass away. Yet if God will
that it continue until all the wealth piled by the bondman's two
hundred and fifty years of unrequited toil shall be sunk, and until
every drop of blood drawn with the lash shall be paid with another
drawn by the sword, as was said three thousand years ago, so must
it still be said, 'The judgments of the Lord are true and righteous
altogether.'"
Thus it appears, that whether Mr. Lincoln was ever accustomed to
blaspheme the name of Jesus Christ or not, or whether he was ever
accustomed to deny His divinity or not, as his defamers allege, he is
willing, in the last eventful days of his life, standing at the nation's
Capitol, in the hearing of the swelling multitude that hangs upon his
lips, to use the sanction of Divine authority to one of the most
remarkable sentences of his official address.
Hon. Isaac N. Arnold, of Chicago, an intimate acquaintance of Mr.
Lincoln, and who is engaged in a review of his work on Mr. Lincoln's
life, writes me that "from the time he left Springfield, with the
touching request for the prayers of his friends and neighbors, to the
day of his death, his words were the words of a Christian, revering
the Bible, and obeying its precepts. A spirit of reverence and deep
religious feeling pervades nearly all the public utterances and state
papers of his later life."
The following interesting testimony from Rev. Dr. Byron Sunderland,
of the First Presbyterian Church of Washington City, gives us a little
insight into the philosophy of Mr. Lincoln's mind and religious
sentiments:

Washington City, Nov. 15th, 1872.


Rev. Jas. A. Reed:
Dear Bro.—It was in the last days of 1862, about the time Mr.
Lincoln was seriously contemplating the issuing of the
Emancipation Proclamation, that I, in company with some
friends of the President, called upon him. After some
conversation, in which he seemed disposed to have his joke and
fun, he settled down to a serious consideration of the subject
before his mind, and for one half-hour poured forth a volume of
the deepest Christian philosophy I ever heard. He began by
saying—
"The ways of God are mysterious and profound beyond all
comprehension—'who by searching can find Him out?' Now,
judging after the manner of men, taking counsel of our
sympathies and feelings, if it had been left to us to determine it,
we would have had no war. And going further back to the
occasion of it, we would have had no slavery. And tracing it still
further back, we would have had no evil. There is the mystery
of the universe which no man can solve, and it is at that point
that the human understanding utterly backs down. And then
there is nothing left but for the heart of man to take up faith
and believe and trust where it cannot reason. Now, I believe we
are all agents and instruments of Divine providence. On both
sides we are working out the will of God; yet how strange the
spectacle! Here is one half the nation prostrated in prayer that
God will help them to destroy the Union and build up a
government upon the cornerstone of human bondage. And here
is the other half equally earnest in their prayers and efforts to
defeat a purpose which they regard as so repugnant to their
ideas of human nature and the rights of society, as well as
liberty and independence. They want slavery; we want freedom.
They want a servile class; we want to make equality practical as
far as possible. And they are Christians, and we are Christians.
They and we are praying and fighting for results exactly the
opposite. What must God think of such a posture of affairs?
There is but one solution—self-deception. Somewhere there is a
fearful heresy in our religion, and I cannot think it lies in the
love of liberty and in the aspirations of the human soul.
"What I am to do in the present emergency time will determine.
I hold myself in my present position and with the authority
vested in me as an instrument of Providence. I have my own
views and purposes, I have my convictions of duty, and my
notions of what is right to be done. But I am conscious every
moment that all I am and all I have is subject to the control of a
Higher Power, and that Power can use me or not use me in any
manner, and at any time, as in His wisdom and might may be
pleasing to Him.
"Nevertheless, I am no fatalist. I believe in the supremacy of
the human conscience, and that men are responsible beings;
that God has a right to hold them, and will hold them, to a strict
personal account for the deeds done in the body. But, sirs, I do
not mean to give you a lecture upon the doctrines of the
Christian religion. These are simply with me the convictions and
realities of great and vital truths, the power and demonstration
of which I see now in the light of this our national struggle as I
have never seen before. God only knows the issue of this
business. He has destroyed nations from the map of history for
their sins. Nevertheless my hopes prevail generally above my
fears for our own Republic. The times are dark, the spirits of
ruin are abroad in all their power, and the mercy of God alone
can save us."
So did the President discourse until we felt we were imposing
on his time, and rising we took our leave of him, confident that
he would be true to those convictions of right and duty which
were derived from so deep a Christian philosophy.
Yours truly,
Byron Sunderland.

The Rev. Dr. Miner, Pastor of the First Baptist Church of Springfield,
who was intimately acquainted with Mr. Lincoln, and visited him and
his family in Washington previous to his death, has left most
interesting testimony in reference to Mr. Lincoln's religious
sentiments, confirmatory of what has been given, and which is
preserved in the archives of the University of Chicago. Dr. Miner
sums up his impressions of Mr. Lincoln as follows: "All that was said
during that memorable afternoon I spent alone with that great and
good man is engraven too deeply on my memory ever to be effaced.
I felt certain of this fact, that if Mr. Lincoln was not really an
experimental Christian, he was acting like one. He was doing his
duty manfully, and looking to God for help in time of need; and, like
the immortal Washington, he believed in the efficacy of prayer, and it
was his custom to read the Scriptures and pray himself." And here I
would relate an incident which occurred on the 4th of March, 1861,
as told me by Mrs. Lincoln. Said she: "Mr. Lincoln wrote the
conclusion of his inaugural address the morning it was delivered.
The family being present, he read it to them. He then said he wished
to be left alone for a short time. The family retired to an adjoining
room, but not so far distant but that the voice of prayer could be
distinctly heard. There, closeted with God alone, surrounded by the
enemies who were ready to take his life, he commended his
country's cause and all dear to him to God's providential care, and
with a mind calmed with communion with his Father in heaven, and
courage equal to the danger, he came forth from that retirement
ready for duty."
With such testimony, gathered from gentlemen of the highest
standing, and much more that I could add to confirm it, I leave the
later life and religious sentiments of Abraham Lincoln to the
dispassionate and charitable judgment of a grateful people. While it
is to be regretted that Mr. Lincoln was not spared to indicate his
religious sentiments by a profession of his faith in accordance with
the institutions of the Christian religion, yet it is very clear that he
had this step in view, and was seriously contemplating it, as a sense
of its fitness and an apprehension of his duty grew upon him. He did
not ignore a relation to the Christian church as an obsolete duty and
an unimportant matter. How often do we hear him thanking God for
the churches! And he was fast bringing his life into conformity to the
Christian standard. The coarse story-telling of his early days was less
indulged in in his later life. Hon. Isaac N. Arnold, and Mr. Carpenter,
as well as Mr. Lincoln's physician at Washington, Dr. Stone, all testify
that "while his stories and anecdotes were racy, witty, and pointed
beyond all comparison," yet they "never heard one of a character
needing palliation or excuse." His physician, Dr. Stone, testifies that
"Mr. Lincoln was the purest-hearted man he ever came in contact
with."
His disposition to attend the theater in later life (if to anyone it
seems to need apology) was not so much a fondness for the
playhouse as a relief from his mental anxiety, and an escape from
the incessant pressure of visitors at the White House. "It is a well-
known fact," says Dr. Miner, "that he would not have been at the
theater on that fatal night, but to escape the multitude who were
that evening pressing into the White House to shake hands with him.
It has been said that Mrs. Lincoln urged her husband to go to the
theater against his will. This is not true. On the contrary, she tried to
persuade him not to go, but he insisted. He said, 'I must have a little
rest. A large and overjoyed, excited people will visit me tonight. My
arms are lame by shaking hands with the multitude, and the people
will pull me to pieces.' He went to the theater, not because he was
interested in the play, but because he was care-worn and needed
quiet and repose. Mrs. Lincoln informed me that he seemed to take
no notice of what was going on in the theater from the time he
entered it till the discharge of the fatal pistol. She said that the last
day he lived was the happiest of his life. The very last moments of
his conscious life were spent in conversation with her about his
future plans, and what he wanted to do when his term of office
expired. He said he wanted to visit the Holy Land and see the places
hallowed by the footprints of the Saviour. He was saying there was
no city he so much desired to see as Jerusalem; and with that word
half spoken on his tongue, the bullet of the assassin entered his
brain, and the soul of the great and good President was carried by
angels to the New Jerusalem above."
APPENDIX V
TWO HERNDON LETTERS CONCERNING LINCOLN'S
RELIGION
BRIEF ANALYSIS OF LINCOLN'S CHARACTER

Springfield, Ill., Sept. 10, 1887.


J. E. Remsburg, Oak Mills, Kansas.
Friend Remsburg: Today I send you Speed's lecture on "Lincoln,"
which you can keep till I send for it—and this will probably be never.
It is a very poor lecture if the lecture contains his knowledge of
Lincoln, and, I guess it does. It shows no insight into Lincoln at all,
though it is well enough written. It is said that Speed had a world of
influence over Lincoln. This may be so, and yet I never saw it. It is
said by Nicolay and Hay that Lincoln poured out his soul to Speed.
Bah! Nonsense! Probably, except in his love scrapes, Lincoln never
poured out his soul to any mortal creature at any time and on no
subject. He was the most secretive, reticent, shut-mouthed man that
ever existed.
You had to guess at the man after years of acquaintance and then
you must look long and keenly before you guessed, or you would
make an ass of yourself.
You had to take some leading—great leading and well-established—
fact of Lincoln's nature and then follow it by accurate and close
analysis wherever it went.
This process would lead you correctly if you knew human nature and
its laws. Lincoln was a mystery to the world; he loved principle, but
moved ever just to suit his own ends; he was a trimmer among
men, though firm on laws and great principles; he did not care for
men; they were his tools and instruments; he was a cool man—an
unsocial one—an abstracted one, having the very quintessence of
the profoundest policies. Lincoln's heart was tender, full of mercy, if
in his presence some imaginative man presented the subject to him.
"Out of sight, out of mind" may truthfully be said of Lincoln. If I am
correct, what do you think of the stories afloat about what Lincoln
said in relation to his religion, especially said to strangers? I send
you two "Truth-Seekers" which you will please read where I speak of
Lincoln in three letters, pages marked at the top. You will learn
something of Lincoln's nature in those three letters of mine—two of
them on Lincoln's religion, and one to a minister. Please read them.
There are some quotations in these letters which I have never had
time to send you as I recollect it. They are good things—one on
Laws of Human Nature and one on the Pride-Haughtiness of
Christians. Lincoln delivered a lecture in which these quotations are
to be found. I heard him deliver it.
W. H. Herndon.
P. S.—Mr. Speed was my boss for three or four years and Lincoln,
Speed, Hurst, and I slept in the same room for a year or so. I was
clerk for Speed. Speed could make Lincoln do much about simple
measures, policies, not involving any principle. Beyond this power
Speed did not have much influence over Lincoln nor did anyone else.
A CARD AND A CORRECTION

I wish to say a few short words to the public and private ear. About
the year 1870 I wrote a letter to F. E. Abbott, then of Ohio, touching
Mr. Lincoln's religion. In that letter I stated that Mr. Lincoln was an
infidel, sometimes bordering on atheism, and I now repeat the
same. In the year 1873 the Right Rev. James A. Reed, pastor and
liar of this city, gave a lecture on Mr. Lincoln's religion, in which he
tried to answer some things which I never asserted, except as to Mr.
Lincoln's infidelity, which I did assert and now and here affirm. Mr.
Lincoln was an infidel of the radical type; he never mentioned the
name of Jesus except to scorn and detest the idea of miraculous
conception. This lecture of the withered minister will be found in
Holland's Review [Scribner's Monthly]. I answered this lecture in
1874, I think, in this city to a large and intelligent audience—had it
printed and sent a copy to Holland, requesting, in polite language,
that he insert it in his Review as an answer to the Reed lecture. The
request was denied me, as a matter of course. He could help to libel
a man with Christian courage, and with Christian cowardice refuse to
unlibel him.
Soon thereafter, say from 1874 to 1882, I saw floating around in the
newspaper literature, such charges as "Herndon is in a lunatic
asylum, well chained," "Herndon is a pauper," "Herndon is a
drunkard," "Herndon is a vile infidel and a knave, a liar and a
drunkard," and the like. I have contradicted all these things under
my own hand, often, except as to my so-called infidelity, liberalism,
free religious opinions, or what-not. In the month of October, 1882, I
saw in and clipped out of the Cherryvale Globe-News of September,
1882, a paper published in the State of Kansas, the following rich
and racy article; it is as follows:

"Lincoln's Old Law Partner a Pauper


"Bill Herndon is a pauper in Springfield, Ill. He was once worth
considerable property. His mind was the most argumentative of
any of the old lawyers in the State, and his memory was
extraordinary. For several years before Lincoln was nominated
for the Presidency, Herndon was in some respects the most
active member of the firm, preparing the greatest number of
cases for trial and making elaborate arguments in their behalf. It
is said that he worked hard with Lincoln in preparing the
memorable speeches by the man who afterward became
President, during the debates between Lincoln and Douglas in
1858, and in constructing the Cooper Union address delivered
by Lincoln a short time before the war. Herndon, with all his
attainments, was a man who now and then went on a spree,
and it was no uncommon thing for him to leave an important
lawsuit and spend several days in drinking and carousing. This
habit became worse after Lincoln's death, and like poor Dick
Yates, Herndon went down step by step till his old friends and
associates point to him as a common drunkard."

There are three distinct charges in the above article. First, that I am
a pauper. Second, that I am a common drunkard, and third, that I
was a traitor or false to my clients. Let me answer these charges in
their order. First, I am not a pauper. Never have been and expect
never to be. I am working on my farm, making my own living with
my own muscle and brain, a place and a calling that even
Christianity with its persecution and malignity can never reach me to
do much harm. I had, it is true, once a considerable property, but
lost much of it in the crash and consequent crisis of 1873, caused in
part by the contraction of the currency, in part by the decline in the
demand for the agricultural products which I raise for sale, in part by
the inability by the people to buy, etc., etc., and for no other
reasons.
Second, I never was a common drunkard, as I look at it, and am not
now. I am and have been for years an ardent and enthusiastic
temperance man, though opposed to prohibition by law, by any
force or other choker. The time has not come for this. It is a fact that
I once, years ago, went on a spree; and this I now deeply regret. It
however is in the past, and let a good life in the future bury the
past. I have not fallen, I have risen, and all good men and women
will applaud the deed, always excepting a small, little, bitter
Christian like the Right Rev. pastor and liar of this city, to whom I
can trace some of the above charges. In my case this minister was
an eager, itching libeler, and what he said of me is false—nay, a
willful lie.
Third, I never was a traitor or untrue to my clients or their interests.
I never left them during the progress of a trial or at other times for
the cause alleged, drunkenness. I may have crept—slid—out of a
case during the trial because I had no faith in it, leaving Mr. Lincoln,
who had faith in it, to run it through. My want of faith in a case
would have been discovered by the jury and that discovery would
have damaged my client and to save my client I dodged. This is all
there is on it, and let men make the most of it.
Now, let me ask a question. Why is all this libeling of me? I am a
mere private citizen, hold no office, do not beg the people to give
me one often. My religious ideas, views, and philosophy are today,
here, unpopular. But wait, I will not deny my ideas, views, or
philosophy for office or station or the applause of the unthinking
multitude. I can, however, answer the above question. It, the
libeling, is done because I did assert and affirm by oral language and
by print that Mr. Lincoln was an infidel, sometimes bordering on
atheism, and yet he was among the best, greatest, and noblest of
mankind; he was a grand man. Why do not the Christians prove that
Mr. Lincoln was an evangelical Christian and thus prove me a liar?
One of my friends, for whom I have great respect, says, that "Mr.
Lincoln was a rational Christian because he believed in morality."
Why not say Lincoln was rational Buddhist, as Buddhism teaches
morality? Why not say Lincoln was rational Mohammedan? By the
way, let me say here, that I have a profound respect for an earnest,
manly, and sincere Christian or an Atheist, a profound respect for an
earnest, manly, and sincere Infidel or theist or any other religion, or
the men who hold it, when that belief is woven into a great manly
character to beautify and greaten the world.
These charges, and I do not know how many more, nor of what
kind, have been scattered broadcast all over the land, and have
gone into every house, have been read at every fireside till the good
people believe them, believe that I am nearly as mean as a little
Christian, and all because I told the truth and stand firm in my
conviction. Respectfully,
W. H. Herndon.
November 9, 1882.
[Privately printed by H. E. Barker, Springfield, 1917, edition limited to
75 copies.]
APPENDIX VI
THE IRWIN ARTICLE WITH LETTERS CONCERNING
LINCOLN'S RELIGIOUS BELIEF
Another Valuable Contribution to the History of the Martyr
President.—Was Abraham Lincoln an Infidel?—A Painstaking
Examination of the Case by An Old Acquaintance.—Important
Testimony of Contemporaneous Witnesses.—History
of the Famous Manuscript of 1833.—Mentor Graham
Says It Was a Defence of Christianity.—The Burned Manuscript
Quite a Different Affair.—The Charge of Infidelity in
1848, Said to Have Been Disproved at the Time.—Letter of
Hon. Wm. Reid, U. S. Consul at Dundee, Scotland.
By B. F. Irwin
Pleasant Plains, Ill., April 20, 1874.
Editor State Journal: For some time, I believe, in 1870 there has
been a constant and continued effort upon the part of the Hon. W.
H. Herndon, Springfield, Ill., to convince and prove to the world that
Abraham Lincoln lived and died an infidel. He has succeded, as I
suppose, in proving that proposition to his own entire satisfaction
and probably to the satisfaction of some others. The last effort I
have noticed upon the subject was Herndon's reply to the Rev. J. A.
Reed, in a lecture delivered in the court house in Springfield, some
months ago. A few days after that lecture was delivered, I was
urgently requested by a prominent minister of the gospel and friend
of Lincoln's (and also a lady friend now residing in Kansas) to review
that speech. I promised each of those persons I would do so at the
proper time. That time has now arrived, and I propose noticing a
few points in the address of Mr. Herndon,
"THE RELIGION OF ABRAHAM LINCOLN"
also a point or two in his Abbott letter and I think I will be able to
show that Mr. Herndon, himself, never knew or understood really
what the faith of Lincoln was or what the
RELIGIOUS BELIEF OF LINCOLN

was. I wish it now and here understood that Mr. Herndon's candor or
veracity I do not call in question. Nor will I designedly say anything
to offend him. He and I have been for twenty-five years good
personal friends, and I hope that friendship may continue. Mr.
Herndon has a right to prove Mr. Lincoln an infidel if he can. I claim
the same right to prove that
LINCOLN WAS NOT AN INFIDEL

if I can. If Mr. Lincoln was an infidel, as Herndon says, it is proper


for the world to know it. If he was not an infidel the charge is wrong
and a slander, for infidelity in the nineteenth century is no honor to
any man, dead or alive.
Mr. Herndon, in his speech, uses this language: "One side of this
question can be proved. It is admitted on all hands that Lincoln once
was an infidel; that he wrote a small book, or essay, or pamphlet
against Christianity, and that he (Lincoln) continued an unbeliever
until late in life." Herndon further says: "It is a rule of law, as well as
a rule of common sense, that when a certain state or condition of
affairs is once proved to exist, the presumption is, that it still exists
until the contrary is proved." Now I stand by that proposition as a
true one. Will Mr. Herndon do so? But
HE IS WOEFULLY MISTAKEN

in his statement that "all admit that Lincoln was once an infidel." I
have never yet heard one single man express the belief that Lincoln
was an infidel, either early or late in life, while I am confident I have
heard one hundred different persons express astonishment at Mr.
Herndon writing and publishing Lincoln to the world an infidel. Mr.
Herndon, it is true, did have opportunities and advantages over
others in knowing Mr. Lincoln's religious opinions. But other men had
some opportunities as well as Mr. Herndon, and to them I shall have
to appeal, for I do not claim to personally know anything about Mr.
Lincoln's religious faith. Though personally acquainted with Lincoln
for twenty-five years, and often in his office, I never heard him say a
word on the subject of Christianity or religious belief. Hence, my
opinion of Lincoln's faith or belief is based on the testimony of those
who do know, who had it
FROM LINCOLN HIMSELF;

and I believe them, for the weight of testimony is certainly against


Mr. Herndon. The Scriptures of Truth lay it down as a Divine rule,
that the evidence of two or three witnesses is better than one.
Common law lays down the same rule, borrowed from Divine
authority, and our courts are governed by it in their decisions.
Mr. Herndon, in his
REPLY TO MR. REED,

says, "He is talking to establish the truth of a controversy between


those who hold that Lincoln was a disbeliever, and those who hold
that he died a Christian (a believer in Christ)" and then says: "If I fail
to establish my point it will be because of the manner and method of
presenting the facts." I have read that lecture carefully over, and I
fail to find any proof of Herndon's proposition that Lincoln ever was
an infidel or an unbeliever. The nearest I see to it, is the
STATEMENT OF J. H. MATHENY

He uses this language, substantially: "Mr. Lincoln's earlier life is his


whole life and history in Illinois up to the time he left for Washington
City. He (Lincoln) was, as I understand it, a confirmed infidel." Now,
Matheny fails to tell us how he got that understanding. Did he get it
from Lincoln? He don't say so, and the reason he don't say so
doubtless is, he got it from some other source—probably from
Herndon. But clearly, to be of any weight as evidence, he must have
that understanding from Mr. Lincoln himself. Mr. Matheny may have
some time in life heard Lincoln use some of the
ARGUMENTS OF TOM PAINE,
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like