Re: Hiding console when running Cygwin utility from Task Scheduler.

2017-08-02 Thread Brian Inglis
On 2017-08-02 17:40, Oleksandr Gavenko wrote:
> On 2017-08-02, Brian Inglis wrote:
>> Redirect all stdin from /dev/null, stdout, stderr to a log file in your
>> script , like:
>>  #!/bin/bash
>>  prog=${0##*/}
>>  base=${prog%.*}
>>  log=/var/log/$base.log
>>
>>  # do everything inside this wrapper
>>  {
>>  ...
>>  } < /dev/null &> $log
>>
>> or equivalent on each command if you don't have many.
> 
> That is not the case for:
> 
> How can I prevent console to be shown when bash started from Task
> Scheduler?
> 
> Closing of stdin / stdout / stderr is task for external process (like CRON) 
> even on UNIX.

I believe that conhost, mintty, ptys, cron, and Cygwin program startup open
handles for stdin, stdout, stderr to talk on, as those are assumed to be
available by most programs, rather than closing anything, which could terminate
program execution.

> With simple:
> 
>   #include 
>   #include 
> 
>   int main(int argc, char **argv) {
>   fclose(stdin);
>   fclose(stdout);
>   fclose(stderr);
> 
>   sleep(10);
> 
>   return 0;
>   }
> 
> in Task Scheduler I see console window and supporting conhost.exe process.
> 
> OK. I know about run.exe from package:
> 
>   run
>   sdesc: "Launch cmdline programs with hidden console"
>   ldesc: "Launch cmdline programs with hidden console"
>   category: Base
>   requires: cygwin
>   version: 1.3.4-2
> 
> I tried:
> 
>   $ cp /bin/run.exe ~/usr/bin/runbash.exe
> 
> and provide path to ~/usr/bin/runbash.exe in Task Scheduler. Console window
> still flashes.
> 
> With my tiny test utility:
> 
>   $ cp /bin/run.exe ~/usr/bin/runxtest.exe
> 
> it flashes too from Task Scheduler but for a moment not 10 sec ))
> 
> Same if I run by Win+R:
> 
>   $ run xtest

Cygwin run allows you to run a Windows GUI program with a hidden console window.
I am never certain whether any Cygwin reference to Windows console and GUI
programs includes or excludes Cygwin command line and X Windows programs.

> My goal to avoid any splashes on screen and possible keyboard focus stealing
> from sudden task execution.

I never see any windows or conhost processes running Cygwin Scheduled Tasks with
the previous suggestions and these settings:

>> You may also have to set the (o) Run whether user is logged on or not
>> radio button, [X] Do not store password..., and [X] Run with highest
>> privileges check boxes.

where the first may be most significant in this case; the second avoids you
having to enter your password any time you make a change; the third is just for
luck! ;^> YMMV

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



accessing iphone files from cygwin

2017-08-02 Thread Cary Lewis
I compiled

ifuse  libimobiledevice  libplist  libusbmuxd  usbmuxd

per instructions I found for compiling these under Ubuntu, and while
they all compiled.


These programs running in a vm under windows with vmware workstation,
can access the iphone without issues.

However I am not able to run ideviceinfo or idevicepair, etc. using
the cygwin compiled binaries.

Has anyone successfully been able access photos or files from a iPhone
under cygwin?

Windows 10 shows an iPhone icon under devices and I know it's accessed
via mtp, but is there no way to access the device from cygwin?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Hiding console when running Cygwin utility from Task Scheduler.

2017-08-02 Thread Oleksandr Gavenko
On 2017-08-02, Brian Inglis wrote:

> Redirect all stdin from /dev/null, stdout, stderr to a log file in your 
> script ,
> like:
>   #!/bin/bash
>   prog=${0##*/}
>   base=${prog%.*}
>   log=/var/log/$base.log
>
>   # do everything inside this wrapper
>   {
>   ...
>   } < /dev/null &> $log
>
> or equivalent on each command if you don't have many.

That is not the case for:

> How can I prevent console to be shown when bash started from Task Scheduler?

Closing of stdin / stdout / stderr is task for external process (like CRON)
even on UNIX.

With simple:

  #include 
  #include 

  int main(int argc, char **argv) {
  fclose(stdin);
  fclose(stdout);
  fclose(stderr);

  sleep(10);

  return 0;
  }

in Task Scheduler I see console window and supporting conhost.exe process.

OK. I know about run.exe from package:

  run
  sdesc: "Launch cmdline programs with hidden console"
  ldesc: "Launch cmdline programs with hidden console"
  category: Base
  requires: cygwin
  version: 1.3.4-2

I tried:

  $ cp /bin/run.exe ~/usr/bin/runbash.exe

and provide path to ~/usr/bin/runbash.exe in Task Scheduler. Console window
still flashes.

With my tiny test utility:

  $ cp /bin/run.exe ~/usr/bin/runxtest.exe

it flashes too from Task Scheduler but for a moment not 10 sec ))

Same if I run by Win+R:

  $ run xtest

My goal to avoid any splashes on screen and possible keyboard focus stealing
from sudden task execution.

-- 
http://defun.work/


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Hiding console when running Cygwin utility from Task Scheduler.

2017-08-02 Thread Brian Inglis
On 2017-08-02 10:06, Oleksandr Gavenko wrote:
> I prepared backup task in Bash script and added task to run it in Windows Task
> Scheduler:
>   Executable: c:\opt\cygwin\bin\bash.exe
>   Params: c:\home\backup\backup-job.bash
> Each time job run I see console screen. 'procmon' shown that it is::
>   \??\C:\Windows\system32\conhost.exe 0x -ForceV1
> Seems each Cygwin utility brings console into foreground. I also tested with:
>   c:\opt\cygwin\bin\yes.exe
> How can I prevent console to be shown when bash started from Task Scheduler?

Redirect all stdin from /dev/null, stdout, stderr to a log file in your script ,
like:
#!/bin/bash
prog=${0##*/}
base=${prog%.*}
log=/var/log/$base.log

# do everything inside this wrapper
{
...
} < /dev/null &> $log

or equivalent on each command if you don't have many.

Ensure you always use the correct hashbang path and the script is executable.

You might also want to change your Task Action Arguments to:
-- /proc/cygdrive/c/home/backup/backup-job.bash
to indicate "--" end of options, there are no options, just args, and use Cygwin
paths for all file arguments.

You may also have to set the (o) Run whether user is logged on or not radio
button, [X] Do not store password..., and [X] Run with highest privileges check
boxes.

I have found it useful to Cygwin symlink all cron/Task scripts to
/usr/local/bin/ and use that path for all script jobs.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Hiding console when running Cygwin utility from Task Scheduler.

2017-08-02 Thread Oleksandr Gavenko
I prepared backup task in Bash script and added task to run it in Windows Task
Scheduler:

  Executable: c:\opt\cygwin\bin\bash.exe
  Params: c:\home\backup\backup-job.bash

Each time job run I see console screen. 'procmon' shown that it is::

  \??\C:\Windows\system32\conhost.exe 0x -ForceV1

Seems each Cygwin utility brings console into foreground. I also tested with:

  c:\opt\cygwin\bin\yes.exe

How can I prevent console to be shown when bash started from Task Scheduler?

-- 
http://defun.work/


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: when using cygwin version 2.8.2 the behavior of CR/LF changed completely compared to previous versions

2017-08-02 Thread David Macek

On 2. 8. 2017 17:34, Roger Krebs wrote:

Hi,

after updating from version 1.7.33 to version 2.8.2 the behavior of CR-LF 
handling completely changed. This results in several srcipt errors etc.


See announcements:

*  for sed
*  for grep
*  for gawk

There was also a discussion about these changes at 
.

--
David Macek



smime.p7s
Description: S/MIME Cryptographic Signature


when using cygwin version 2.8.2 the behavior of CR/LF changed completely compared to previous versions

2017-08-02 Thread Roger Krebs
Hi,

after updating from version 1.7.33 to version 2.8.2 the behavior of CR-LF 
handling completely changed. This results in several srcipt errors etc.

Two examples:
1) using wmic together with grep

Executing "wmic process get ExecutablePath,processID,commandline /FORMAT:CSV | 
od -t a" shows that each line from the output of wmic ends with CR CR LF. 
That's normal and works in the same way under both cygwin versions.
Executing "wmic process get ExecutablePath,processID,commandline /FORMAT:CSV | 
grep "," |od -t a" has different outputs. Under version 1.7.33 the lines ends 
with LF, under version 2.8.2 the lines still ends with CR CR LF.
If you use cut to extract the last field (the processID) you will get the pure 
processID (number) under version 1.7.33 but the processID followed by CR CR 
(string) under version 2.8.2.
When using grep CR characters at the end of the line should usually be cut of 
to make sure the $ sign can be used in regexp as end of line marker.

2) using awk and reading from DOS files
===
When reading number values from a DOS file (each line contains only a number) 
using awk and writing this number into an array variable works perfectly under 
version 1.7.33. But under version 2.8.2 all array variables are filled with the 
number followed by a CR.
   { WebOrderID[$1] = NR; }
This issue can be solved by defining RS="\r\n" in the BEGIN section of the awk 
script. But in the past it works fine without setting the record separator.

In addition we have now problems using svn under cygwin: when using a working 
copy that isn't located on a local drive but on a remote (SMB) filing system it 
will not recognized as working copy anymore. Error message:  isn't 
a valid working copy. Doing exact the same (for example "svn info") from a 
machine with cygwin 1.7.33 installed everything works fine.

First I was unsure if something general has changed since version 1.7.33 that 
has to be taken into account now. But after spending hours on reading mail 
list, FAQ and searching the internet without finding a solution I assume, this 
may be an error in cygwin. Especially because it's one of the key features of 
cygwin to map CR LF <=> LF on the fly.

I've also downgraded the cygwin.dd to version 2.8.1.1 without any change in the 
behavior. And it doesn't matter, if it is a fresh install of version 2.8.2 or 
an update from a previous version.

Also the mount point hasn't changed
Version 1.7.33
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,noacl,posix=0,noumount,auto)

Version 2.8.2:
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,noacl,posix=0,noumount,auto)

Attached you will find the "cygcheck -sv" output from version 2.8.2 as well as 
from the previously used version 1.7.33 (it's still installed on some machines).

Best Regards

Roger Krebs



Cygwin Configuration Diagnostics
Current System Time: Wed Aug 02 10:37:52 2017

Windows 2008 R2 Server Standard Ver 6.1 Build 7601 Service Pack 1

Path:   C:\cygwin\usr\local\bin
C:\cygwin\bin
C:\cygwin\bin
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0

Output from C:\cygwin\bin\id.exe
UID: 112961(itse_d_operator10) GID: 100513(Domänen-Benutzer)
=100513(Domänen-Benutzer) 545(Benutzer)
544(Administratoren)   555(Remotedesktopbenutzer)
4(INTERAKTIV)  66049(KONSOLENANMELDUNG)
11(Authentifizierte Benutzer)  15(Diese Organisation)
4095(CurrentSession)   1056993(D_HAM_KoMaTo)
1054666(DE_Alle)   1064339(mediaportal-de-light)
1056937(D_CRM_Presse_Verwalter)1063234(D_HAM_SVN_User)
1057038(D_HAM_Ticket_IT)   1059959(4232 User DE SE)
1061243(D_Appl_CCBu)   1056981(D_Elektra)
1057174(D_PARMA_VERWALTER) 1071014(D_CRM_Presse_Verwalter)
1075183(D_HAM_KoMaTo)  1052553(DE_Alle)
1070980(D_PARMA_VERWALTER) 1049832(D_Elektra)
405504(Hohe Verbindlichkeitsstufe)

SysDir: C:\Windows\system32
WinDir: C:\Windows

USER = 'itse_d_operator10'
PWD = '/home/itse_d_operator10'
HOME = '/home/itse_d_operator10'

USERDOMAIN = 'SEDE'
OS = 'Windows_NT'
PROCESSOR_LEVEL = '6'
PSModulePath = 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\'
CommonProgramW6432 = 'C:\Program Files\Common Files'
SSH_CONNECTION = '10.49.141.81 57407 10.49.143.73 22'
CommonProgramFiles(x86) = 'C:\Program Files (x86)\Common Files'
FP_NO_HOST_CHECK = 'NO'
LANG = 'de_DE.UTF-8'
TZ = 'Europe/Berlin'
CommonProgramFiles = 'C:\Program Files\Common Files'
HOSTNAME = 'SDEHAMGWM11'
PUBLIC = 'C:\Users\Public'
OLDPWD = '/home/itse_d_operator10'
USERNAME = 'itse_d_operator10'

RE: Cygwin-X icons not appearing after Cygwin 64 bit install w/X selected as "install"

2017-08-02 Thread Cowan, Brian R
I started a terminal as a local administrator and reran 
/etc/postinstall/xinit.sh.done

I got a bunch of "key exists" messages, but my icons appeared... I THINK the 
setup asked for elevation. I'll have to check that shortly.

Brian

-Original Message-
From: cygwin-ow...@cygwin.com [mailto:cygwin-ow...@cygwin.com] On Behalf Of Ken 
Brown
Sent: Tuesday, August 1, 2017 10:12 PM
To: cygwin@cygwin.com
Subject: Re: Cygwin-X icons not appearing after Cygwin 64 bit install w/X 
selected as "install"

On 8/1/2017 6:11 PM, Cowan, Brian R wrote:
> Hello all,
> 
> I'm reinstalling Cygwin after wiping my system and am finding that the inst= 
> all doesn't create any icons for the X server/apps. A little annoying since=  
> this is the primary reason I'm installing Cygwin.

The postinstall script /etc/postinstall/xinit.sh should have created a Start 
Menu shortcut "XWin Server" under the heading "Cygwin-X".

Ken

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Ruby ri does not display core docs - is it a bug or do I miss a package?

2017-08-02 Thread Ronald Fischer
I have installed Ruby and the Ruby-doc package (and also some other doc
packages related to Ruby gems). However, ri does not work for core
packages. Example:


$ ri String
= String < Object

(from gem bigdecimal-1.3.2)
--
= Instance methods:

  to_d

(from gem rake-11.3.0)
--
= Instance methods:

  ext, pathmap, pathmap_explode, pathmap_partial, pathmap_replace

We can see that String related methods from the gems are displayed, but
not what is in the core package. Similarily:

$ ri 'String#length'
Nothing known about String#length

Is this a bug?


cygcheck.out
Description: Binary data

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple

Re: Recursively recreate hierarchy with NTFS hardlinks by Cygwin

2017-08-02 Thread Oleksandr Gavenko
On 2017-08-02, Oleksandr Gavenko wrote:

> Experiments shown that my goal can be archived in single command:
>
>   mkdir orig
>   echo 1 >>orig/my.txt
>
>   mkdir backup
>   rsync -a orig/ backup/1
>   rsync -a --link-dest=../1 orig/ backup/2
>
>   echo 2 >>backup/2/my.txt
>   cmp backup/1/my.txt backup/2/my.txt && echo ok
>   cmp orig/my.txt backup/2/my.txt || echo ok

``fsutil`` is built-in Windows utility:

  bash# fsutil hardlink list backup/2/my.txt
  \home\tmp\backup\1\my.txt
  \home\tmp\backup\2\my.txt

  bash# mv backup/1 backup/3

  bash# fsutil hardlink list backup/2/my.txt
  \home\tmp\backup\3\my.txt
  \home\tmp\backup\2\my.txt

That is additional proof of work.

My bash backup script looks like:

  LOG=/cygdrive/c/home/backup/backup-job.log
  DST=/cygdrive/d/backup

  DATE=`date +%F`

  COMMON_RSYNC_OPT=( -a --delete )

  log() {
echo `date +'%F %T'` "$@" >>$LOG
  }

  backup_simple() {
local SRC=$1
local BASE=${SRC##*/}

if [ ! -d $SRC ]; then
log "$SRC does not exist, leave"
return
fi
if [ -d $DST/$BASE/$DATE ]; then
log "$SRC is already backuped to $DST/$BASE/$DATE"
return
fi
if [ ! -d $DST/$BASE ]; then
mkdir -p $DST/$BASE
fi
local LAST=`cd $DST/$BASE; find . -maxdepth 1 -type d | grep 
'[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}' | sort -r | head`
local RSYNC_OPT=( "${COMMON_RSYNC_OPT[@]}" )
if [ -n "$LAST" ]; then
RSYNC_OPT+=( --link-dest=../$LAST )
fi
rsync "${RSYNC_OPT[@]}" $SRC/ $DST/$BASE/$DATE/
log "$BASE is backuped"
  }

  backup_simple /cygdrive/c/home/devel/soapui
  backup_simple /cygdrive/c/home/devel/postman



What options is recommended for using Cygwin's rsync?

Backuped files don't need to preserve permission, ACL, etc. The goal is to
preserve hierarchy and content and make backuping lightweight (with
timestamps/size checks and hardlinks).

I collected list of:

  -t --no-p --no-l --no-acls --no-o --no-g --no-D -O -J -m --no-partial --delete

to ignore most of file meta-information and make time/size bases checks.



What is the better way to schedule backup task?

I've got familiar with Windows Task Scheduler, it has interesting options:

* run task as soon as possible after scheduler start is missed
* stop task if it runs longer then
* wake the computer to run this task

Do I need to bother with Cygwin CRON?

-- 
http://defun.work/


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Recursively recreate hierarchy with NTFS hardlinks by Cygwin

2017-08-02 Thread Oleksandr Gavenko
On 2017-08-02, Oleksandr Gavenko wrote:

> On Linux I uses:
>
>   cp -al /backup/proj/DATEOLD  /backup/proj/DATENEW
>   rsync ... /home/user/proj/ /backup/proj/DATENEW/
>
> and employ hardlinks to preserve space.
>
> ``rsync --hard-links`` isn't reliable:
>
>   bash# echo 1 >orig.txt
>
>   bash# rsync -a --hard-links orig.txt new.txt
>
>   bash# echo 2 >>orig.txt
>
>   bash# diff -u orig.txt new.txt
>   --- orig.txt2017-08-02 14:04:36.976875300 +0300
>   +++ new.txt 2017-08-02 14:04:16.547209000 +0300
>   @@ -1,2 +1 @@
>1
>   -2
>

Experiments shown that my goal can be archived in single command:

  mkdir orig
  echo 1 >>orig/my.txt

  mkdir backup
  rsync -a orig/ backup/1
  rsync -a --link-dest=../1 orig/ backup/2

  echo 2 >>backup/2/my.txt
  cmp backup/1/my.txt backup/2/my.txt && echo ok
  cmp orig/my.txt backup/2/my.txt || echo ok

Thanks for Cygwin & rsync with NTFS link support!

-- 
http://defun.work/


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Recursively recreate hierarchy with NTFS hardlinks by Cygwin

2017-08-02 Thread Oleksandr Gavenko
I am going to write backup solution for my personal laptop.

I have 240GB SSD for development work and 500GB HDD for media files and
backups.

I am care only about project files and don't care about windows files or
program installation (as registry also should be preserved for backup to be
useful).

On Linux I uses:

  cp -al /backup/proj/DATEOLD  /backup/proj/DATENEW
  rsync ... /home/user/proj/ /backup/proj/DATENEW/

and employ hardlinks to preserve space.

NTFS FS has hardlinks. With ``cygutils-extra`` I can:

  $ winln $FROM $TO
  $ echo >>$FROM
  $ cmp $FROM $TO && echo OK

But I don't understand how to emulate recursive behavior of ``cp -r -l``.

Cygwin ``cp -l`` can use hard links but only with:

  CYGWIN=winsymlinks:native

``rsync --hard-links`` isn't reliable:

  bash# echo 1 >orig.txt

  bash# rsync -a --hard-links orig.txt new.txt

  bash# echo 2 >>orig.txt

  bash# diff -u orig.txt new.txt
  --- orig.txt2017-08-02 14:04:36.976875300 +0300
  +++ new.txt 2017-08-02 14:04:16.547209000 +0300
  @@ -1,2 +1 @@
   1
  -2


There is Windows build-in ``robocopy`` utility but its documentation looks too
complex, I don't like to mix Cygwin and Windows paths and looks like it
doesn't support hard link from "Robocopy.exe /? | grep -i hard".

As development of rdiff-backup stalled in 2009 I don't believe that it
supports hard links in native Windows build.

As a bonus I am also interested to hear about solution with include data
integrity checks to detect data altering or rotting of storage bits in backup.
I think about employing md5sum utility...

-- 
http://defun.work/


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[newlib-cygwin] cygwin: add explicit_bzero, elf.h changes to release

2017-08-02 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=109a3a02a3855bae4be5ab6fe641366c7694b978

commit 109a3a02a3855bae4be5ab6fe641366c7694b978
Author: Yaakov Selkowitz 
Date:   Wed Aug 2 04:38:01 2017 -0500

cygwin: add explicit_bzero, elf.h changes to release

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 winsup/cygwin/release/2.8.3 | 4 
 1 file changed, 4 insertions(+)

diff --git a/winsup/cygwin/release/2.8.3 b/winsup/cygwin/release/2.8.3
index 5cecabb..c76d571 100644
--- a/winsup/cygwin/release/2.8.3
+++ b/winsup/cygwin/release/2.8.3
@@ -1,10 +1,14 @@
 What's new:
 ---
 
+- New API: explicit_bzero.
+
 
 What changed:
 -
 
+- Improved implementation of .
+
 
 Bug Fixes
 -


[newlib-cygwin] Add elf.h to newlib

2017-08-02 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4aaec3cb88b333731ab844046d6f01145f81e9e1

commit 4aaec3cb88b333731ab844046d6f01145f81e9e1
Author: Yaakov Selkowitz 
Date:   Wed Aug 2 01:15:31 2017 -0500

Add elf.h to newlib

This is copied from musl (MIT license).  This is newer and more thorough
than that of FreeBSD currently shipped only on Cygwin.

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 newlib/libc/include/elf.h   | 3146 +++
 winsup/cygwin/include/elf.h |   41 -
 winsup/cygwin/include/machine/elf.h |  117 --
 winsup/cygwin/include/sys/elf.h |   41 -
 winsup/cygwin/include/sys/elf32.h   |  245 ---
 winsup/cygwin/include/sys/elf64.h   |  248 ---
 winsup/cygwin/include/sys/elf_common.h  | 1110 ---
 winsup/cygwin/include/sys/elf_generic.h |   88 -
 8 files changed, 3146 insertions(+), 1890 deletions(-)

diff --git a/newlib/libc/include/elf.h b/newlib/libc/include/elf.h
new file mode 100644
index 000..1b62db5
--- /dev/null
+++ b/newlib/libc/include/elf.h
@@ -0,0 +1,3146 @@
+/*
+From musl include/elf.h
+
+Copyright © 2005-2014 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef _ELF_H
+#define _ELF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+typedef uint16_t Elf32_Half;
+typedef uint16_t Elf64_Half;
+
+typedef uint32_t Elf32_Word;
+typedefint32_t  Elf32_Sword;
+typedef uint32_t Elf64_Word;
+typedefint32_t  Elf64_Sword;
+
+typedef uint64_t Elf32_Xword;
+typedefint64_t  Elf32_Sxword;
+typedef uint64_t Elf64_Xword;
+typedefint64_t  Elf64_Sxword;
+
+typedef uint32_t Elf32_Addr;
+typedef uint64_t Elf64_Addr;
+
+typedef uint32_t Elf32_Off;
+typedef uint64_t Elf64_Off;
+
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
+
+typedef Elf32_Half Elf32_Versym;
+typedef Elf64_Half Elf64_Versym;
+
+#define EI_NIDENT (16)
+
+typedef struct {
+  unsigned chare_ident[EI_NIDENT];
+  Elf32_Half   e_type;
+  Elf32_Half   e_machine;
+  Elf32_Word   e_version;
+  Elf32_Addr   e_entry;
+  Elf32_Offe_phoff;
+  Elf32_Offe_shoff;
+  Elf32_Word   e_flags;
+  Elf32_Half   e_ehsize;
+  Elf32_Half   e_phentsize;
+  Elf32_Half   e_phnum;
+  Elf32_Half   e_shentsize;
+  Elf32_Half   e_shnum;
+  Elf32_Half   e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct {
+  unsigned chare_ident[EI_NIDENT];
+  Elf64_Half   e_type;
+  Elf64_Half   e_machine;
+  Elf64_Word   e_version;
+  Elf64_Addr   e_entry;
+  Elf64_Offe_phoff;
+  Elf64_Offe_shoff;
+  Elf64_Word   e_flags;
+  Elf64_Half   e_ehsize;
+  Elf64_Half   e_phentsize;
+  Elf64_Half   e_phnum;
+  Elf64_Half   e_shentsize;
+  Elf64_Half   e_shnum;
+  Elf64_Half   e_shstrndx;
+} Elf64_Ehdr;
+
+#define EI_MAG00
+#define ELFMAG00x7f
+
+#define EI_MAG11
+#define ELFMAG1'E'
+
+#define EI_MAG22
+#define ELFMAG2'L'
+
+#define EI_MAG33
+#define ELFMAG3'F'
+
+
+#defineELFMAG  "\177ELF"
+#defineSELFMAG 4
+
+#define EI_CLASS   4
+#define ELFCLASSNONE   0
+#define ELFCLASS32 1
+#define ELFCLASS64 2
+#define ELFCLASSNUM3
+
+#define EI_DATA5
+#define ELFDATANONE0
+#define ELFDATA2LSB1
+#define ELFDATA2MSB2
+#define ELFDATANUM 3
+
+#define EI_VERSION 6
+
+
+#define EI_OSABI   7
+#define ELFOSABI_NONE  0
+#define ELFOSABI_SYSV  0
+#define ELFOSABI_HPUX  1
+#define ELFOSABI_NETBSD2
+#define ELFOSABI_LINUX 3
+#define ELFOSABI_GNU   3
+#define ELFOSABI_SOLARIS   6
+#define ELFOSABI_AIX   7
+#define ELFOSABI_IRIX  8
+#define ELFOSABI_FREEBSD   9
+#define ELFOSABI_TRU64 10
+#define ELFOSABI_MODESTO   11
+#define ELFOSABI_OPENBSD   12
+#define 

[newlib-cygwin] cygwin: Export explicit_bzero

2017-08-02 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2c83bc950fec04feb76a018a994598deb3787256

commit 2c83bc950fec04feb76a018a994598deb3787256
Author: Yaakov Selkowitz 
Date:   Wed Aug 2 01:09:49 2017 -0500

cygwin: Export explicit_bzero

This was added to newlib together with timingsafe_*cmp but never exported.

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 winsup/cygwin/common.din   | 1 +
 winsup/cygwin/include/cygwin/version.h | 3 ++-
 winsup/doc/posix.xml   | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index 08baa9e..73e6768 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -433,6 +433,7 @@ exp2f NOSIGFE
 exp2l NOSIGFE
 expf NOSIGFE
 expl NOSIGFE
+explicit_bzero NOSIGFE
 expm1 NOSIGFE
 expm1f NOSIGFE
 expm1l NOSIGFE
diff --git a/winsup/cygwin/include/cygwin/version.h 
b/winsup/cygwin/include/cygwin/version.h
index bbb6326..ce548b1 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -478,12 +478,13 @@ details. */
   311: Export __xpg_sigpause.
   312: Export strverscmp, versionsort.
   313: Export fls, flsl, flsll.
+  314: Export explicit_bzero.
 
   Note that we forgot to bump the api for ualarm, strtoll, strtoull,
   sigaltstack, sethostname. */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 313
+#define CYGWIN_VERSION_API_MINOR 314
 
 /* There is also a compatibity version number associated with the shared memory
regions.  It is incremented when incompatible changes are made to the shared
diff --git a/winsup/doc/posix.xml b/winsup/doc/posix.xml
index bc50643..5ce5988 100644
--- a/winsup/doc/posix.xml
+++ b/winsup/doc/posix.xml
@@ -1139,6 +1139,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).
 endusershell
 err
 errx
+explicit_bzero
 feof_unlocked
 ferror_unlocked
 fflush_unlocked


Re: [PATCH] Add elf.h to newlib

2017-08-02 Thread Corinna Vinschen
On Aug  2 01:21, Yaakov Selkowitz wrote:
> This is copied from musl (MIT license).  This is newer and more thorough
> than that of FreeBSD currently shipped only on Cygwin.

Please push.


Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


signature.asc
Description: PGP signature


Re: [PATCH] cygwin: Export explicit_bzero

2017-08-02 Thread Corinna Vinschen
On Aug  2 01:11, Yaakov Selkowitz wrote:
> This was added to newlib together with timingsafe_*cmp but never exported.
> 
> Signed-off-by: Yaakov Selkowitz 
> ---
>  winsup/cygwin/common.din   | 1 +
>  winsup/cygwin/include/cygwin/version.h | 3 ++-
>  winsup/doc/posix.xml   | 1 +
>  3 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
> index 08baa9e07..73e676841 100644
> --- a/winsup/cygwin/common.din
> +++ b/winsup/cygwin/common.din
> @@ -433,6 +433,7 @@ exp2f NOSIGFE
>  exp2l NOSIGFE
>  expf NOSIGFE
>  expl NOSIGFE
> +explicit_bzero NOSIGFE
>  expm1 NOSIGFE
>  expm1f NOSIGFE
>  expm1l NOSIGFE
> diff --git a/winsup/cygwin/include/cygwin/version.h 
> b/winsup/cygwin/include/cygwin/version.h
> index bbb632626..ce548b13a 100644
> --- a/winsup/cygwin/include/cygwin/version.h
> +++ b/winsup/cygwin/include/cygwin/version.h
> @@ -478,12 +478,13 @@ details. */
>311: Export __xpg_sigpause.
>312: Export strverscmp, versionsort.
>313: Export fls, flsl, flsll.
> +  314: Export explicit_bzero.
>  
>Note that we forgot to bump the api for ualarm, strtoll, strtoull,
>sigaltstack, sethostname. */
>  
>  #define CYGWIN_VERSION_API_MAJOR 0
> -#define CYGWIN_VERSION_API_MINOR 313
> +#define CYGWIN_VERSION_API_MINOR 314
>  
>  /* There is also a compatibity version number associated with the shared 
> memory
> regions.  It is incremented when incompatible changes are made to the 
> shared
> diff --git a/winsup/doc/posix.xml b/winsup/doc/posix.xml
> index bc506434f..5ce5988bc 100644
> --- a/winsup/doc/posix.xml
> +++ b/winsup/doc/posix.xml
> @@ -1139,6 +1139,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).
>  endusershell
>  err
>  errx
> +explicit_bzero
>  feof_unlocked
>  ferror_unlocked
>  fflush_unlocked
> -- 
> 2.13.2

Yep, please push (and update release info).


Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


signature.asc
Description: PGP signature


[PATCH] cygwin: Export explicit_bzero

2017-08-02 Thread Yaakov Selkowitz
This was added to newlib together with timingsafe_*cmp but never exported.

Signed-off-by: Yaakov Selkowitz 
---
 winsup/cygwin/common.din   | 1 +
 winsup/cygwin/include/cygwin/version.h | 3 ++-
 winsup/doc/posix.xml   | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index 08baa9e07..73e676841 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -433,6 +433,7 @@ exp2f NOSIGFE
 exp2l NOSIGFE
 expf NOSIGFE
 expl NOSIGFE
+explicit_bzero NOSIGFE
 expm1 NOSIGFE
 expm1f NOSIGFE
 expm1l NOSIGFE
diff --git a/winsup/cygwin/include/cygwin/version.h 
b/winsup/cygwin/include/cygwin/version.h
index bbb632626..ce548b13a 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -478,12 +478,13 @@ details. */
   311: Export __xpg_sigpause.
   312: Export strverscmp, versionsort.
   313: Export fls, flsl, flsll.
+  314: Export explicit_bzero.
 
   Note that we forgot to bump the api for ualarm, strtoll, strtoull,
   sigaltstack, sethostname. */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 313
+#define CYGWIN_VERSION_API_MINOR 314
 
 /* There is also a compatibity version number associated with the shared memory
regions.  It is incremented when incompatible changes are made to the shared
diff --git a/winsup/doc/posix.xml b/winsup/doc/posix.xml
index bc506434f..5ce5988bc 100644
--- a/winsup/doc/posix.xml
+++ b/winsup/doc/posix.xml
@@ -1139,6 +1139,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).
 endusershell
 err
 errx
+explicit_bzero
 feof_unlocked
 ferror_unlocked
 fflush_unlocked
-- 
2.13.2