summaryrefslogtreecommitdiff
path: root/src/port
AgeCommit message (Collapse)Author
2008-05-21Use CRITICAL_SECTION instead of Mutexes for thread-locking in libpq onMagnus Hagander
Windows, for better performance. Per suggestion from Andrew Chernow, but not his patch since the underlying code was changed to deal with return values.
2008-05-17Add $PostgreSQL$ markers to a lot of files that were missing them.Andrew Dunstan
This particular batch was just for *.c and *.h file. The changes were made with the following 2 commands: find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o \( -name '*.[ch]' \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | while read file ; do head -n 1 < $file | grep -q '^/\*' && echo $file; done | xargs -l sed -i -e '1s/^\// /' -e '1i/*\n * $PostgreSQL:$ \n *' find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o \( -name '*.[ch]' \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | xargs -l sed -i -e '1i/*\n * $PostgreSQL:$ \n */'
2008-05-16Fix declarations of pthread functions, missed in recent commit.Tom Lane
2008-05-14Make the win32 implementation of getrusage() return EINVAL if beingMagnus Hagander
asked for anything other than RUSAGE_SELF, since it's not supported. This is never called anywhere in the code today, but might be in the future. Not backpatching, since it's not called anywhere today.
2008-04-22Don't pull in pthreads header files in this file because we never use them.Magnus Hagander
2008-04-18Fix rmtree() so that it keeps going after failure to remove any individualTom Lane
file; the idea is that we should clean up as much as we can, even if there's some problem removing one file. Make the error messages a bit less misleading, too. In passing, const-ify function arguments.
2008-04-18Fix two race conditions between the pending unlink mechanism that was put inHeikki Linnakangas
place to prevent reusing relation OIDs before next checkpoint, and DROP DATABASE. First, if a database was dropped, bgwriter would still try to unlink the files that the rmtree() call by the DROP DATABASE command has already deleted, or is just about to delete. Second, if a database is dropped, and another database is created with the same OID, bgwriter would in the worst case delete a relation in the new database that happened to get the same OID as a dropped relation in the old database. To fix these race conditions: - make rmtree() ignore ENOENT errors. This fixes the 1st race condition. - make ForgetDatabaseFsyncRequests forget unlink requests as well. - force checkpoint on in dropdb on all platforms Since ForgetDatabaseFsyncRequests() is asynchronous, the 2nd change isn't enough on its own to fix the problem of dropping and creating a database with same OID, but forcing a checkpoint on DROP DATABASE makes it sufficient. Per Tom Lane's bug report and proposal. Backpatch to 8.3.
2008-04-16Fix MinGW warnings re formats and unused variables. per ITAGAKI TakahiroAndrew Dunstan
2008-04-11A quick try at un-breaking the Cygwin build. Whether it needs theTom Lane
pgwin32_safestat remains to be determined, but in any case the current code is not tolerable.
2008-04-10Create wrapper pgwin32_safestat() and redefine stat() to itMagnus Hagander
on win32, because the stat() function in the runtime cannot be trusted to always update the st_size field. Per report and research by Sergey Zubkovsky.
2008-03-31Fix a number of places that were making file-type tests infelicitously.Tom Lane
The places that did, eg, (statbuf.st_mode & S_IFMT) == S_IFDIR were correct, but there is no good reason not to use S_ISDIR() instead, especially when that's what the other 90% of our code does. The places that did, eg, (statbuf.st_mode & S_IFDIR) were flat out *wrong* and would fail in various platform-specific ways, eg a symlink could be mistaken for a regular file on most Unixen. The actual impact of this is probably small, since the problem cases seem to always involve symlinks or sockets, which are unlikely to be found in the directories that PG code might be scanning. But it's clearly trouble waiting to happen, so patch all the way back anyway. (There seem to be no occurrences of the mistake in 7.4.)
2008-03-21More README src cleanups.Bruce Momjian
2008-03-18Fix our printf implementation to follow spec: if a star parameterTom Lane
value for a precision is negative, act as though precision weren't specified at all, that is the whole .* part of the format spec should be ignored. Our previous coding took it as .0 which is certainly wrong. Per report from Kris Jurka and local testing. Possibly this should be back-patched, but it would be good to get some more testing first; in any case there are no known cases where there's really a problem on the backend side.
2008-02-29Fix handling of restricted processes for Windows Vista (mainly),Magnus Hagander
by explicitly adding back the user to the DACL of the new process. This fixes the failure case when executing as the Administrator user, which had no permissions left at all after we dropped the Administrators group. Dave Page with some modifications from me
2008-02-18Added --htmldir option to pg_config, equivalent to the new configure option.Peter Eisentraut
2008-02-13Stamp HEAD as 8.4devel.Tom Lane
2008-01-01Update copyrights in source tree to 2008.Bruce Momjian
2007-12-28may -> mightPeter Eisentraut
2007-12-27Wording improvementsPeter Eisentraut
2007-12-20On win32, loop when opening files if sharing- och lock-violation errorsMagnus Hagander
occur. Hopefully, this will make it possible to recover from broken antivirus and/or backup software that locks our files.
2007-11-30Use _dosmaperr() to deal with errors opening files in pgwin32_open().Magnus Hagander
Per complaint from Alvaro and subsequent discussion.
2007-11-15pgindent run for 8.3.Bruce Momjian
2007-10-25Add new encoding aliases for Solaris, per Zdenek Kotala.Alvaro Herrera
2007-10-23Use snprintf instead of wsprintf, and use getenv("APPDATA") instead ofMagnus Hagander
SHGetFolderPath. This removes the direct dependency on shell32.dll and user32.dll, which eats a lot of "desktop heap" for each backend that's started. The desktop heap is a very limited resource, causing backends to no longer start once it's been exhausted. We still have indirect depdendencies on user32.dll through third party libraries, but those can't easily be removed. Dave Page
2007-10-17Add missing entry for PG_WIN1250 encoding, per gripe from Pavel Stehule.Tom Lane
Also enable translation of PG_WIN874, which certainly seems to have an obvious translation now, though maybe it did not at the time this table's ancestor was created.
2007-10-10Add missing codepage numbers for Windows.Magnus Hagander
Dave Page
2007-10-03Teach chklocale.c how to extract encoding info from Windows localeTom Lane
names. ITAGAKI Takahiro
2007-09-29Teach chklocale.c about a few names for frontend-only encodings,Tom Lane
since this will allow initdb to reject attempts to initdb in a locale that uses such an encoding. We'll probably find out more such names during beta ...
2007-09-28On OS X, assume that an empty-string result for nl_langinfo(CODESET)Tom Lane
means UTF-8. Per examination of /usr/share/locale in 10.4.10.
2007-09-28Change initdb and CREATE DATABASE to actively reject attempts to createTom Lane
databases with encodings that are incompatible with the server's LC_CTYPE locale, when we can determine that (which we can on most modern platforms, I believe). C/POSIX locale is compatible with all encodings, of course, so there is still some usefulness to CREATE DATABASE's ENCODING option, but this will insulate us against all sorts of recurring complaints caused by mismatched settings. I moved initdb's existing LC_CTYPE-to-encoding mapping knowledge into a new src/port/ file so it could be shared by CREATE DATABASE.
2007-07-25Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict withMagnus Hagander
third party includes (like tcl) that define DLLIMPORT.
2007-07-12Get dirmod.c on the same page as port.h about whether we use pgsymlinkTom Lane
on Cygwin (answer: we don't). Also try to unwind the #ifdef spaghetti a little bit. Untested but hopefully I didn't break anything.
2007-04-18Silence mingw compiler warningMagnus Hagander
2007-04-13Add O_DIRECT support on Windows.Magnus Hagander
ITAGAKI Takahiro
2007-04-03Update comment for new thread_test location.Bruce Momjian
2007-03-26Remove advertising clause from Berkeley BSD-licensed files, perBruce Momjian
instructions from Berkeley.
2007-03-18Code cleanup for function prototypes: change two K&R-style prototypesNeil Conway
to ANSI-style, and change "()" -> "(void)". Patch from Stefan Huehner.
2007-02-13Add comment to explain why O_EXCL and O_TRUNC can be ignored inBruce Momjian
openFlagsToCreateFileFlags() in certain cases.
2007-02-09Replace useless uses of := by = in makefiles.Peter Eisentraut
2007-02-07Add strlcat() from OpenBSD, to be used for replacing strncat and otherPeter Eisentraut
strange coding practices.
2007-01-29Use sizeof() for snprintf() buffer length.Bruce Momjian
2007-01-29Update process termination message to display signal number and nameBruce Momjian
from exec.c and postmaster.c.
2007-01-28Drat, can't fit an additional argument into log_error. Is it worth anTom Lane
sprintf pushup to be sure we can report something useful for out-of-range exitstatus?
2007-01-28Clean up broken usage of HAVE_DECL_SYS_SIGLIST and inconsistent/poorlyTom Lane
formatted error messages.
2007-01-28Use autoconf build-in sys_siglist macro AC_DECL_SYS_SIGLIST, rather thanBruce Momjian
create our own.
2007-01-28Add signal.h for sys_siglist reference.Bruce Momjian
2007-01-28Use sys_siglist[] to print out signal names for signal exits, ratherBruce Momjian
than just numbers.
2007-01-23Remove newline from error message because URL is gone.Bruce Momjian
2007-01-23Back out use of FormatMessage(), does error values, not exceptionBruce Momjian
values. Point to /include/ntstatus.h for an exception list, rather than a URL.
2007-01-23Print meaningfull error text for abonormal process exit on Win32, ratherBruce Momjian
than hex codes, using FormatMessage().