summaryrefslogtreecommitdiff
path: root/src/win32
Commit message (Collapse)AuthorAgeFilesLines
* win32: provide fast-path for retrying filesystem operationsethomson/win32_remediateEdward Thomson2017-07-261-11/+9
| | | | | | | | | | When using the `do_with_retries` macro for retrying filesystem operations in the posix emulation layer, allow the remediation function to return `GIT_RETRY`, meaning that the error was believed to be remediated, and the operation should be retried immediately, without a sleep. This is a slightly more general solution to the problem fixed in #4312.
* fixed win32 p_unlink retry sleep issueCarson Howard2017-07-261-1/+6
| | | Fixed an issue where the retry logic on p_unlink sleeps before it tries setting a file to write mode causing unnecessary slowdown.
* win32: `remediation` not `cleanup`ethomson/win32_posixEdward Thomson2017-04-171-2/+2
| | | | | | The `remediation` function is run in the retry loop in order to attempt to fix any problems that the prior run encountered. There is nothing "cleaned up". Clarify the name.
* win32: enable `p_utimes` for readonly filesEdward Thomson2017-04-051-88/+131
| | | | | Instead of failing to set the timestamp of a read-only file (like any object file), set it writable temporarily to update the timestamp.
* win32: make posix emulation retries configurableEdward Thomson2017-04-032-1/+3
| | | | | | | POSIX emulation retries should be configurable so that tests can disable them. In particular, maniacally threading tests may end up trying to open locked files and need retries, which will slow continuous integration tests significantly.
* win32: do not inherit file descriptorsEdward Thomson2017-04-031-1/+8
|
* Allow to configure default file share mode for opening filesSven Strickroth2017-04-032-11/+8
| | | | | | This can prevent FILE_SHARED_VIOLATIONS when used in tools such as TortoiseGit TGitCache and FILE_SHARE_DELETE, because files can be opened w/o being locked any more. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* win32: deduplicate code: use p_open in p_creatSven Strickroth2017-04-021-8/+1
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* win32: use CreateFile in p_openSven Strickroth2017-04-021-5/+57
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* win32: teach p_open about do_with_retriesEdward Thomson2017-04-021-21/+12
|
* win32: teach p_unlink about do_with_retriesEdward Thomson2017-04-021-47/+35
|
* win32: make p_rename use do_with_retriesEdward Thomson2017-04-021-39/+24
|
* win32: introduce `do_with_retries` macroEdward Thomson2017-04-011-0/+21
| | | | | | Provide a macro that will allow us to run a function with posix-like return values multiple times in a retry loop, with an optional cleanup function called between invocations.
* win32: map windows error codes to errnoEdward Thomson2017-04-011-0/+113
| | | | | | | | | | Introduce mapping from windows error codes to errno values. This allows us to replace our calls to the Windows posix emulation functions with calls to the Win32 APIs for more fine-grained control over the emulation. These mappings match the Windows CRT's mappings for its posix emulation as they were described to me.
* Merge remote-tracking branch 'origin/pr/3790' into win32_posixEdward Thomson2017-03-311-7/+39
|\
| * Add retries to win32 p_unlink and p_open.Tyler Church2016-05-181-7/+39
| |
* | odb_loose: fsync testsEdward Thomson2017-02-281-0/+2
| | | | | | | | | | | | | | Introduce a simple counter that `p_fsync` implements. This is useful for ensuring that `p_fsync` is called when we expect it to be, for example when we have enabled an odb backend to perform `fsync`s when writing objects.
* | giterr_set: consistent error messagesEdward Thomson2016-12-296-14/+14
| | | | | | | | | | | | | | | | Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
* | Properly pass `wchar *` type to giterr_setBoris Barbulovski2016-12-061-1/+1
| |
* | Properly pass `wchar *` type to giterr_setBoris Barbulovski2016-11-201-1/+1
| |
* | threads: introduce `git_thread_exit`Edward Thomson2016-11-182-0/+20
| | | | | | | | | | | | | | | | | | | | Introduce `git_thread_exit`, which will allow threads to terminate at an arbitrary time, returning a `void *`. On Windows, this means that we need to store the current `git_thread` in TLS, so that we can set its `return` value when terminating. We cannot simply use `ExitThread`, since Win32 returns `DWORD`s from threads; we return `void *`.
* | Make sure we use the `C` locale for `regcomp` on macOS.Arthur Schreiber2016-10-061-0/+3
| |
* | threads: add platform-independent thread initialization functionPatrick Steinhardt2016-06-202-31/+30
| |
* | win32: rename pthread.{c,h} to thread.{c,h}Patrick Steinhardt2016-06-203-5/+5
| | | | | | | | | | | | | | | | | | | | The old pthread-file did re-implement the pthreads API with exact symbol matching. As the thread-abstraction has now been split up between Unix- and Windows-specific files within the `git_` namespace to avoid symbol-clashes between libgit2 and pthreads, the rewritten wrappers have nothing to do with pthreads anymore. Rename the Windows-specific pthread-files to honor this change.
* | threads: remove now-useless typedefsPatrick Steinhardt2016-06-201-7/+0
| |
* | threads: remove unused function pthread_num_processors_npPatrick Steinhardt2016-06-202-13/+0
| | | | | | | | | | The function pthread_num_processors_np is currently unused and superseded by the function `git_online_cpus`. Remove the function.
* | threads: split up OS-dependent rwlock codePatrick Steinhardt2016-06-202-19/+13
| |
* | threads: split up OS-dependent thread-condition codePatrick Steinhardt2016-06-202-13/+9
| |
* | threads: remove unused function pthread_cond_broadcastPatrick Steinhardt2016-06-202-5/+0
| |
* | threads: split up OS-dependent mutex codePatrick Steinhardt2016-06-202-18/+13
| |
* | threads: split up OS-dependent thread codePatrick Steinhardt2016-06-202-27/+8
|/
* Split the page size from the mmap alignmentcmn/pool-limitCarlos Martín Nieto2016-03-161-5/+24
| | | | | | | | While often similar, these are not the same on Windows. We want to use the page size on Windows for the pools, but for mmap we need to use the allocation granularity as the alignment. On the other platforms these values remain the same.
* nsec: support NDK's crazy nanosecondsEdward Thomson2016-02-251-0/+3
| | | | | | | | Android NDK does not have a `struct timespec` in its `struct stat` for nanosecond support, instead it has a single nanosecond member inside the struct stat itself. We will use that and use a macro to expand to the `st_mtim` / `st_mtimespec` definition on other systems (much like the existing `st_mtime` backcompat definition).
* Merge pull request #3606 from ethomson/drop_xpCarlos Martín Nieto2016-02-181-18/+3
|\ | | | | win32: drop xp support in WideCharToMultiByte
| * win32: drop xp support in WideCharToMultiByteEdward Thomson2016-02-091-18/+3
| |
* | fstat: use our custom `stat`Edward Thomson2016-02-163-12/+62
| |
* | win32: introduce p_timeval that isn't stupidEdward Thomson2016-02-124-5/+13
|/ | | | | Windows defines `timeval` with `long`, which we cannot sanely cope with. Instead, use a custom timeval struct.
* Make stat.st_size a __int64 not a uint64_tJacques Germishuys2015-11-211-1/+1
|
* Merge pull request #3170 from CmdrMoozy/nsec_fixCarlos Martín Nieto2015-11-124-17/+56
|\ | | | | git_index_entry__init_from_stat: set nsec fields in entry stats
| * Merge branch 'master' into nsec_fix_nextAxel Rasmussen2015-10-011-8/+15
| |\
| * | win32: define our own POSIX struct stat, and support USE_NSECAxel Rasmussen2015-09-184-17/+56
| | |
* | | config: add a ProgramData levelcmn/programdata-configCarlos Martín Nieto2015-10-212-0/+11
| |/ |/| | | | | | | This is where portable git stores the global configuration which we can use to adhere to it even though git isn't quite installed on the system.
* | win32: propogate filename too long errorsEdward Thomson2015-09-221-8/+15
|/
* win32: return EACCES in `p_lstat`Edward Thomson2015-09-171-2/+9
| | | | | | Don't coalesce all errors into ENOENT. At least identify EACCES. All callers should be handling this case already, as the POSIX `lstat` will return this.
* Merge pull request #3352 from ethomson/hiddenEdward Thomson2015-08-282-8/+42
|\ | | | | win32: ensure hidden files can be staged
| * win32: ensure hidden files can be stagedEdward Thomson2015-08-032-8/+42
| |
* | Fix duplicate basenames to support older VSJohn Haley2015-08-052-2/+1
|/ | | | | | | With Visual Studio versions 2008 and older they ignore the full path to files and only check the basename of the file to find a collision. Additionally, having duplicate basenames can break other build tools like GYP. This fixes https://github.com/libgit2/libgit2/issues/3356
* Merge pull request #3288 from ethomson/getenvCarlos Martín Nieto2015-07-071-0/+2
|\ | | | | git__getenv: utf-8 aware env reader
| * git__getenv: utf-8 aware env readerEdward Thomson2015-07-021-0/+2
| | | | | | | | | | | | Introduce `git__getenv` which is a UTF-8 aware `getenv` everywhere. Make `cl_getenv` use this to keep consistent memory handling around return values (free everywhere, as opposed to only some platforms).
* | Reserve aux_id 0; sort leaks by aux_id. Fix cmp.Jeff Hostetler2015-06-292-10/+28
| |