summaryrefslogtreecommitdiff
path: root/src/unix
Commit message (Collapse)AuthorAgeFilesLines
* Fix segmentation fault observed on OpenBSD/sparc64cmn/mmap-readableStefan Sperling2014-11-031-4/+2
| | | | | A non-readable mapping of a file causes an access violation in the pack tests. Always use PROT_READ to work around this.
* Merge commit 'refs/pull/2366/head' of github.com:libgit2/libgit2Carlos Martín Nieto2014-10-271-2/+8
|\
| * Fix compiler warning (git_off_t cast to size_t).Albert Meltzer2014-05-191-2/+8
| | | | | | | | | | | | Use size_t for page size, instead of long. Check result of sysconf. Use size_t for page offset so no cast to size_t (second arg to p_mmap). Use mod instead div/mult pair, so no cast to size_t is necessary.
* | Introduce some consistency in definition/declaration orderingJacques Germishuys2014-08-051-4/+3
| |
* | Move p_realpath logic to realpath.cJacques Germishuys2014-08-052-14/+9
| |
* | Cleanup portability/compatibility layerJacques Germishuys2014-08-051-1/+22
| | | | | | | | | | | | | | * Removes mingw-compat.h * Cleans up separation of compiler/platform idiosyncrasies * Unifies mingw/msvc stat structures and functions * (Tries to) hide more compiler specific implementation details (even in our internal API)
* | Fix unix/posix.h include guardJacques Germishuys2014-07-131-2/+2
|/
* indexer: use mmap for writingCarlos Martín Nieto2014-05-171-0/+6
| | | | | | Some OSs cannot keep their ideas about file content straight when mixing standard IO with file mapping. As we use mmap for reading from the packfile, let's make writing to the pack file use mmap.
* Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-191-1/+0
|
* Test cancel from indexer progress callbackRussell Belfer2013-12-111-1/+1
| | | | | | | | | | | | | | | This adds tests that try canceling an indexer operation from within the progress callback. After writing the tests, I wanted to run this under valgrind and had a number of errors in that situation because mmap wasn't working. I added a CMake option to force emulation of mmap and consolidated the Amiga-specific code into that new place (so we don't actually need separate Amiga code now, just have to turn on -DNO_MMAP). Additionally, I made the indexer code propagate error codes more reliably than it used to.
* Add missing prototype for p_realpath().Jasper Lievisse Adriaanse2013-04-221-0/+2
|
* Fix compilation on OpenBSDCarlos Martín Nieto2013-04-151-1/+1
|
* Make tree iterator handle icase equivalenceRussell Belfer2013-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | There is a serious bug in the previous tree iterator implementation. If case insensitivity resulted in member elements being equivalent to one another, and those member elements were trees, then the children of the colliding elements would be processed in sequence instead of in a single flattened list. This meant that the tree iterator was not truly acting like a case-insensitive list. This completely reworks the tree iterator to manage lists with case insensitive equivalence classes and advance through the items in a unified manner in a single sorted frame. It is possible that at a future date we might want to update this to separate the case insensitive and case sensitive tree iterators so that the case sensitive one could be a minimal amount of code and the insensitive one would always know what it needed to do without checking flags. But there would be so much shared code between the two, that I'm not sure it that's a win. For now, this gets what we need. More tests are needed, though.
* Fix p_realpath on OpenBSDCarlos Martín Nieto2013-01-292-1/+36
| | | | | | OpenBSD's realpath(3) doesn't require the last part of the path to exist. Override p_realpath in this OS to bring it in line with the library's assumptions.
* update copyrightsEdward Thomson2013-01-082-2/+2
|
* Add POSIX compat lstat() variant for win32Russell Belfer2012-11-141-0/+3
| | | | | | | | | | The existing p_lstat implementation on win32 is not quite POSIX compliant when setting errno to ENOTDIR. This adds an option to make is be compliant so that code (such as checkout) that cares to have separate behavior for ENOTDIR can use it portably. This also contains a couple of other minor cleanups in the posix_w32.c implementations to avoid unnecessary work.
* Move inet_pton to posix platform-compatibility layerEduardo Bart2012-11-071-0/+1
|
* Always use internal fnmatch, not systemRussell Belfer2012-10-151-7/+0
|
* posix: Always set a default mapping modeVicent Marti2012-08-261-0/+2
|
* Some cleanup suggested during reviewRussell Belfer2012-08-221-1/+0
| | | | | | | | | | This cleans up a number of items suggested during code review with @vmg, including: * renaming "outside repo" config API to `git_config_open_default` * killing the `git_config_open_global` API * removing the `git_` prefix from the static functions in fileops * removing some unnecessary functionality from the "cp" command
* Add template dir and set gid to repo initRussell Belfer2012-08-221-0/+1
| | | | | | | | | | | | | | | | | This extends git_repository_init_ext further with support for initializing the repository from an external template directory and with support for the "create shared" type flags that make a set GID repository directory. This also adds tests for much of the new functionality to the existing `repo/init.c` test suite. Also, this adds a bunch of new utility functions including a very general purpose `git_futils_mkdir` (with the ability to make paths and to chmod the paths post-creation) and a file tree copying function `git_futils_cp_r`. Also, this includes some new path functions that were useful to keep the code simple.
* Merge branch 'development' into cloneBen Straub2012-07-172-1/+3
|\
| * Make this more generic and mergeable.Chris Young2012-06-131-17/+1
| | | | | | | | | | | | | | | | | | Needs AmigaOS.cmake now from CMake package at OS4Depot, or contents below: --8<-- SET(AMIGA 1) SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") --8<--
| * Actually do the mmap... unsurprisingly, this makes the indexer work on SFSChris Young2012-06-121-4/+4
| | | | | | | | | | On RAM: the .idx and .pack files become links to a .lock and the original download respectively. Assume some feature (such as record locking) supported by SFS but not JXFS or RAM: is required.
| * Basic mmap/munmap compatiblityChris Young2012-06-101-3/+16
| |
| * no fnmatch.hChris Young2012-06-071-1/+1
| |
| * Merge remote-tracking branch 'source/development' into update-testChris Young2012-06-072-25/+50
| |\ | | | | | | | | | | | | | | | | | | Merging main libgit2! Conflicts: CMakeLists.txt src/unix/map.c
| * | Assume this is irrelevant for nowChris Young2012-06-051-2/+6
| | |
* | | Checkout: handle symlinks.Ben Straub2012-07-161-0/+1
| |/ |/| | | Includes unfinished win32 implementation.
* | Fix readdir_r() usage for SolarisScott J. Goldman2012-05-121-0/+2
| | | | | | | | | | | | | | | | On Solaris, struct dirent is defined differently than Linux. The field containing the path name is of size 0, rather than NAME_MAX. So, we need to use a properly sized buffer on Solaris to avoid a stack overflow. Also fix some DIR* leaks on cleanup.
* | Hook up Windows compat fnmatch() for SolarisScott J. Goldman2012-05-101-2/+6
| | | | | | | | | | | | | | | | Since Solaris does not support some of the same flags as glibc fnmatch(), we just use the implementation we have for Windows. Now that it's no longer a windows-specific thing, I moved it into compat/ instead of win32/
* | Resolve comments from pull requestRussell Belfer2012-03-131-2/+1
| | | | | | | | | | | | | | This converts the map validation function into a macro, tweaks the GITERR_OS system error automatic appending, and adds a tentative new error access API and some quick unit tests for both the old and new error APIs.
* | Migrate ODB files to new error handlingRussell Belfer2012-03-121-23/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to the new style of error handling. Also got the unix and win32 versions of map.c. There are some minor changes to other files but no others were completely converted. This also contains an update to filebuf so that a zeroed out filebuf will not think that the fd (== 0) is actually open (and inadvertently call close() on fd 0 if cleaned up). Lastly, this was built and tested on win32 and contains a bunch of fixes for the win32 build which was pretty broken.
* | Update diff to use iteratorsRussell Belfer2012-03-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
* | Fix readdir usage across platformsRussell Belfer2012-02-231-0/+1
| | | | | | | | | | | | This fixes the missing readdir_r from win32 and fixes other platforms to always use the reentrant readdir_r form for reading directory contents.
* | Update Copyright headerschu2012-02-132-2/+2
| | | | | | | | Signed-off-by: schu <schu-github@schulog.org>
* | Create cross-platform setenvPaul Betts2011-09-191-0/+1
| |
* | Cleanup legal dataVicent Marti2011-09-192-0/+12
| | | | | | | | | | | | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* | compat: Move `mkstemp` to the POSIX compat layerVicent Marti2011-08-301-0/+1
| |
* | posix: Properly handle `snprintf` in all platformsVicent Marti2011-08-181-0/+1
| |
* | unix/posix.h: remove redundant includeschu2011-08-171-1/+0
| | | | | | | | Signed-off-by: schu <schu-github@schulog.org>
* | posix: Portable `vsnprintf`Vicent Marti2011-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our good, lovely folks at Microsoft decided that there was no good reason to make `vsnprintf` compilant with the C standard, so that function in Windows returns -1 on overflow, instead of returning the actual byte count needed to write the full string. We now handle this situation more gracefully with the POSIX compatibility layer, by returning the needed byte size using an auxiliary method instead of blindly resizing the target buffer until it fits. This means we can now support `printf`s of any size by allocating a temporary buffer. That's good.
* | fnmatch: Use native on Unix, emulate on Win32Vicent Marti2011-07-061-0/+2
| |
* | fileops: Drop `git_fileops_prettify_path`Vicent Marti2011-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | The old `git_fileops_prettify_path` has been replaced with `git_path_prettify`. This is a much simpler method that uses the OS's `realpath` call to obtain the full path for directories and resolve symlinks. The `realpath` syscall is the original POSIX call in Unix system and an emulated version under Windows using the Windows API.
* | fileops: CleanupVicent Marti2011-07-052-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.
* | build: Move OS-specific compat to their own foldersVicent Marti2011-07-031-0/+64
| |
* | build: Simplify build structureVicent Marti2011-07-011-61/+0
|/ | | | This will make libgit2 more suitable for embedding.
* unix/map.c: Move to new error handling mechanismJakob Pfender2011-05-231-5/+5
|
* Revised platform types to use 'best supported' size.Alex Budovski2011-01-111-1/+1
| | | | | This will allow graceful migration to 64 bit file sizes and timestamps should git's binary interface be extended to allow this.
* Remove git_errnoVicent Marti2010-12-231-1/+1
| | | | | | | | | It was not being used by any methods (only by malloc and calloc), and since it needs to be TLS, it cannot be exported on DLLs on Windows. Burn it with fire. The API always returns error codes! Signed-off-by: Vicent Marti <tanoku@gmail.com>